diff options
author | David Howells <dhowells@redhat.com> | 2017-11-02 18:27:46 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-11-13 18:38:17 +0300 |
commit | 9ed900b1160ef306bc74ad0228d7ab199234c758 (patch) | |
tree | f2e3ed236dce6980e51e8216e9e06ffbf9c1d989 /fs/afs/dir.c | |
parent | 49566f6f06b38d7c1a5c7eacc8a38c6ea2e36549 (diff) | |
download | linux-9ed900b1160ef306bc74ad0228d7ab199234c758.tar.xz |
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/dir.c')
-rw-r--r-- | fs/afs/dir.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 613a77058263..97ec6a74589e 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -771,7 +771,7 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) vnode->update_cnt++; spin_unlock(&vnode->lock); afs_vnode_finalise_status_update(vnode, server); - afs_put_server(server); + afs_put_server(afs_i2net(dir), server); d_instantiate(dentry, inode); if (d_unhashed(dentry)) { @@ -783,7 +783,7 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) return 0; iget_error: - afs_put_server(server); + afs_put_server(afs_i2net(dir), server); mkdir_error: key_put(key); error: @@ -948,7 +948,7 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, vnode->update_cnt++; spin_unlock(&vnode->lock); afs_vnode_finalise_status_update(vnode, server); - afs_put_server(server); + afs_put_server(afs_i2net(dir), server); d_instantiate(dentry, inode); if (d_unhashed(dentry)) { @@ -960,7 +960,7 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, return 0; iget_error: - afs_put_server(server); + afs_put_server(afs_i2net(dir), server); create_error: key_put(key); error: @@ -1060,7 +1060,7 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry, vnode->update_cnt++; spin_unlock(&vnode->lock); afs_vnode_finalise_status_update(vnode, server); - afs_put_server(server); + afs_put_server(afs_i2net(dir), server); d_instantiate(dentry, inode); if (d_unhashed(dentry)) { @@ -1072,7 +1072,7 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry, return 0; iget_error: - afs_put_server(server); + afs_put_server(afs_i2net(dir), server); create_error: key_put(key); error: |