diff options
| author | Linus Torvalds <[email protected]> | 2025-03-13 17:53:25 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2025-03-13 17:53:25 +0000 |
| commit | 8f7617f4500900f39b604ca724a34a9cfd1fa63a (patch) | |
| tree | ce68936726e5db07f2c6fc2ae9e0b57accebf680 /fs/afs/dynroot.c | |
| parent | Merge tag 'sched_ext-for-6.14-rc6-fixes' of git://git.kernel.org/pub/scm/linu... (diff) | |
| parent | vboxsf: Add __nonstring annotations for unterminated strings (diff) | |
| download | kernel-8f7617f4500900f39b604ca724a34a9cfd1fa63a.tar.gz kernel-8f7617f4500900f39b604ca724a34a9cfd1fa63a.zip | |
Merge tag 'vfs-6.14-rc7.fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs
Pull vfs fixes from Christian Brauner:
- Bring in an RCU pathwalk fix for afs. This is brought in as a merge
from the vfs-6.15.shared.afs branch that needs this commit and other
trees already depend on it.
- Fix vboxfs unterminated string handling.
* tag 'vfs-6.14-rc7.fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs:
vboxsf: Add __nonstring annotations for unterminated strings
afs: Fix afs_atcell_get_link() to handle RCU pathwalk
Diffstat (limited to 'fs/afs/dynroot.c')
| -rw-r--r-- | fs/afs/dynroot.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index d8bf52f77d93..008698d706ca 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -314,12 +314,23 @@ static const char *afs_atcell_get_link(struct dentry *dentry, struct inode *inod const char *name; bool dotted = vnode->fid.vnode == 3; - if (!net->ws_cell) + if (!dentry) { + /* We're in RCU-pathwalk. */ + cell = rcu_dereference(net->ws_cell); + if (dotted) + name = cell->name - 1; + else + name = cell->name; + /* Shouldn't need to set a delayed call. */ + return name; + } + + if (!rcu_access_pointer(net->ws_cell)) return ERR_PTR(-ENOENT); down_read(&net->cells_lock); - cell = net->ws_cell; + cell = rcu_dereference_protected(net->ws_cell, lockdep_is_held(&net->cells_lock)); if (dotted) name = cell->name - 1; else |
