[PATCH 05/26] SQUASHME: pnfs-submit: ensure pnfs_update_layout clears lsegp on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Compensate for pnfs_update_layout returning error but assigning lseg.

Signed-off-by: Fred Isaman <iisaman@xxxxxxxxxx>
---
 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 6717a9d..c73ab80 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1042,6 +1042,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__);
@@ -1056,6 +1058,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

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux