summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-06-15 20:32:02 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-06-15 20:36:33 +0200
commit9e2dfdb3081edfae66a49013517e80dd8a0469fa (patch)
tree8b919ceb047bb75a4525ba64ba930026e4e148c4 /fs/nfs/pnfs.c
parentnfs4.1: prevent race that allowed use of freed layout in _pnfs_return_layout (diff)
downloadlinux-9e2dfdb3081edfae66a49013517e80dd8a0469fa.tar.xz
linux-9e2dfdb3081edfae66a49013517e80dd8a0469fa.zip
nfs4.1: mark layout as bad on error path in _pnfs_return_layout
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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 730d4dbbaf68..539b94cb6c0f 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -652,6 +652,8 @@ _pnfs_return_layout(struct inode *ino)
lrp = kzalloc(sizeof(*lrp), GFP_KERNEL);
if (unlikely(lrp == NULL)) {
status = -ENOMEM;
+ set_bit(NFS_LAYOUT_RW_FAILED, &lo->plh_flags);
+ set_bit(NFS_LAYOUT_RO_FAILED, &lo->plh_flags);
put_layout_hdr(lo);
goto out;
}