export.c (762f99f4f3cb41a775b5157dd761217beba65873) export.c (ba9ea771ec8a9da4e3aa5cb8c8549fc3b15b2641)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Overlayfs NFS export support.
4 *
5 * Amir Goldstein <amir73il@gmail.com>
6 *
7 * Copyright (C) 2017-2018 CTERA Networks. All Rights Reserved.
8 */

--- 377 unchanged lines hidden (view full) ---

386
387 /*
388 * We also need to take a snapshot of real dentry name to protect us
389 * from racing with underlying layer rename. In this case, we don't
390 * care about returning ESTALE, only from dereferencing a free name
391 * pointer because we hold no lock on the real dentry.
392 */
393 take_dentry_name_snapshot(&name, real);
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Overlayfs NFS export support.
4 *
5 * Amir Goldstein <amir73il@gmail.com>
6 *
7 * Copyright (C) 2017-2018 CTERA Networks. All Rights Reserved.
8 */

--- 377 unchanged lines hidden (view full) ---

386
387 /*
388 * We also need to take a snapshot of real dentry name to protect us
389 * from racing with underlying layer rename. In this case, we don't
390 * care about returning ESTALE, only from dereferencing a free name
391 * pointer because we hold no lock on the real dentry.
392 */
393 take_dentry_name_snapshot(&name, real);
394 /*
395 * No mnt_userns handling here: it's an internal lookup. Could skip
396 * permission checking altogether, but for now just use non-mnt_userns
397 * transformed ids.
398 */
394 this = lookup_one_len(name.name.name, connected, name.name.len);
395 release_dentry_name_snapshot(&name);
396 err = PTR_ERR(this);
397 if (IS_ERR(this)) {
398 goto fail;
399 } else if (!this || !this->d_inode) {
400 dput(this);
401 err = -ENOENT;

--- 471 unchanged lines hidden ---
399 this = lookup_one_len(name.name.name, connected, name.name.len);
400 release_dentry_name_snapshot(&name);
401 err = PTR_ERR(this);
402 if (IS_ERR(this)) {
403 goto fail;
404 } else if (!this || !this->d_inode) {
405 dput(this);
406 err = -ENOENT;

--- 471 unchanged lines hidden ---