diff options
author | Fred Isaman <iisaman@netapp.com> | 2011-06-14 00:54:53 +0200 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-06-15 17:24:30 +0200 |
commit | a2e1d4f2e5ed83850de92a491ef225824cb457bd (patch) | |
tree | a97ec1b7e83b254e9b7179425e848d72cd6c3db3 /fs/nfs/pnfs.c | |
parent | NFSv4.1: allow zero fh array in filelayout decode layout (diff) | |
download | linux-a2e1d4f2e5ed83850de92a491ef225824cb457bd.tar.xz linux-a2e1d4f2e5ed83850de92a491ef225824cb457bd.zip |
nfs4.1: fix several problems with _pnfs_return_layout
_pnfs_return_layout had the following problems:
- it did not call pnfs_free_lseg_list on all paths
- it unintentionally did a forgetful return when there was no outstanding io
- it raced with concurrent LAYOUTGETS
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 8c1309d852a6..25de6b27bdf4 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -634,12 +634,14 @@ _pnfs_return_layout(struct inode *ino) spin_lock(&ino->i_lock); lo = nfsi->layout; - if (!lo || !mark_matching_lsegs_invalid(lo, &tmp_list, NULL)) { + if (!lo) { spin_unlock(&ino->i_lock); - dprintk("%s: no layout segments to return\n", __func__); - goto out; + dprintk("%s: no layout to return\n", __func__); + return status; } stateid = nfsi->layout->plh_stateid; + mark_matching_lsegs_invalid(lo, &tmp_list, NULL); + lo->plh_block_lgets++; /* Reference matched in nfs4_layoutreturn_release */ get_layout_hdr(lo); spin_unlock(&ino->i_lock); |