summaryrefslogtreecommitdiffstats
path: root/fs/afs/super.c
diff options
context:
space:
mode:
authorDavid Howells2017-11-02 16:27:46 +0100
committerDavid Howells2017-11-13 16:38:17 +0100
commit9ed900b1160ef306bc74ad0228d7ab199234c758 (patch)
treef2e3ed236dce6980e51e8216e9e06ffbf9c1d989 /fs/afs/super.c
parentafs: Note the cell in the superblock info also (diff)
downloadkernel-qcow2-linux-9ed900b1160ef306bc74ad0228d7ab199234c758.tar.gz
kernel-qcow2-linux-9ed900b1160ef306bc74ad0228d7ab199234c758.tar.xz
kernel-qcow2-linux-9ed900b1160ef306bc74ad0228d7ab199234c758.zip
afs: Push the net ns pointer to more places
Push the network namespace pointer to more places in AFS, including the afs_server structure (which doesn't hold a ref on the netns). In particular, afs_put_cell() now takes requires a net ns parameter so that it can safely alter the netns after decrementing the cell usage count - the cell will be deallocated by a background thread after being cached for a period, which means that it's not safe to access it after reducing its usage count. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/super.c')
-rw-r--r--fs/afs/super.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/afs/super.c b/fs/afs/super.c
index e43f94ecc391..dd218f370359 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -206,7 +206,7 @@ static int afs_parse_options(struct afs_mount_params *params,
false);
if (IS_ERR(cell))
return PTR_ERR(cell);
- afs_put_cell(params->cell);
+ afs_put_cell(params->net, params->cell);
params->cell = cell;
break;
@@ -314,7 +314,7 @@ static int afs_parse_device_name(struct afs_mount_params *params,
cellnamesz, cellnamesz, cellname ?: "");
return PTR_ERR(cell);
}
- afs_put_cell(params->cell);
+ afs_put_cell(params->net, params->cell);
params->cell = cell;
}
@@ -409,8 +409,8 @@ static struct afs_super_info *afs_alloc_sbi(struct afs_mount_params *params)
static void afs_destroy_sbi(struct afs_super_info *as)
{
if (as) {
- afs_put_volume(as->net, as->volume);
- afs_put_cell(as->cell);
+ afs_put_volume(as->cell, as->volume);
+ afs_put_cell(as->net, as->cell);
afs_put_net(as->net);
kfree(as);
}
@@ -494,7 +494,7 @@ static struct dentry *afs_mount(struct file_system_type *fs_type,
as = NULL;
}
- afs_put_cell(params.cell);
+ afs_put_cell(params.net, params.cell);
key_put(params.key);
_leave(" = 0 [%p]", sb);
return dget(sb->s_root);
@@ -504,7 +504,7 @@ error_sb:
error_as:
afs_destroy_sbi(as);
error:
- afs_put_cell(params.cell);
+ afs_put_cell(params.net, params.cell);
key_put(params.key);
_leave(" = %d", ret);
return ERR_PTR(ret);