mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
namei: move cross-device check to traverse_mounts
This is preparation to RESOLVE_NO_XDEV fix in following commits. No functional change intended Signed-off-by: Askar Safin <safinaskar@zohomail.com> Link: https://lore.kernel.org/20250825181233.2464822-2-safinaskar@zohomail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner
parent
7f9d34b0a7
commit
11c2b7ec2e
11
fs/namei.c
11
fs/namei.c
@@ -1518,6 +1518,7 @@ static inline int traverse_mounts(struct path *path, bool *jumped,
|
||||
int *count, unsigned lookup_flags)
|
||||
{
|
||||
unsigned flags = smp_load_acquire(&path->dentry->d_flags);
|
||||
int ret;
|
||||
|
||||
/* fastpath */
|
||||
if (likely(!(flags & DCACHE_MANAGED_DENTRY))) {
|
||||
@@ -1526,7 +1527,11 @@ static inline int traverse_mounts(struct path *path, bool *jumped,
|
||||
return -ENOENT;
|
||||
return 0;
|
||||
}
|
||||
return __traverse_mounts(path, flags, jumped, count, lookup_flags);
|
||||
|
||||
ret = __traverse_mounts(path, flags, jumped, count, lookup_flags);
|
||||
if (*jumped && unlikely(lookup_flags & LOOKUP_NO_XDEV))
|
||||
return -EXDEV;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int follow_down_one(struct path *path)
|
||||
@@ -1631,9 +1636,7 @@ static inline int handle_mounts(struct nameidata *nd, struct dentry *dentry,
|
||||
}
|
||||
ret = traverse_mounts(path, &jumped, &nd->total_link_count, nd->flags);
|
||||
if (jumped) {
|
||||
if (unlikely(nd->flags & LOOKUP_NO_XDEV))
|
||||
ret = -EXDEV;
|
||||
else
|
||||
if (!unlikely(nd->flags & LOOKUP_NO_XDEV))
|
||||
nd->state |= ND_JUMPED;
|
||||
}
|
||||
if (unlikely(ret)) {
|
||||
|
||||
Reference in New Issue
Block a user