[PATCH 05/24] SQUASHME: ensure pnfs_update_lseg clears lsegp on error

Fred Isaman
2010-06-08T04:19:46Z

This should be squashed into my (or alexandros's)submission patches for
version 2. Compensate for Alexandros returning error but assigning lseg.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
fs/nfs/pnfs.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 2f8fa3c..b990471 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1064,6 +1064,8 @@ pnfs_update_layout(struct inode *ino,
DEFINE_WAIT(__wait);
int result = 0;

+ if (take_ref)
+ *lsegpp = NULL;
lo = get_lock_alloc_layout(ino);
if (IS_ERR(lo)) {
dprintk("%s ERROR: can't get pnfs_layout_type\n", __func__);
@@ -1078,6 +1080,7 @@ pnfs_update_layout(struct inode *ino,
put_lseg(lseg);

/* someone is cleaning the layout */
+ lseg = NULL;
result = -EAGAIN;
goto out_put;
}
--
1.6.6.1