diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index 691e0ae607a1..61bc8c81c5ca 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -348,9 +348,9 @@ static int afs_dynroot_readdir(struct file *file, struct dir_context *ctx) } if ((unsigned long long)ctx->pos <= AFS_MAX_DYNROOT_CELL_INO) { - rcu_read_lock(); + down_read(&file_inode(file)->i_rwsem); ret = afs_dynroot_readdir_cells(net, ctx); - rcu_read_unlock(); + up_read(&file_inode(file)->i_rwsem); } return ret; }