[PATCH 1/2] NFS4.1: filelayout_commit_pagelist needs to pass back error

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

 



It was reporting success even if it did nothing.

Note this is still not right.  Caller nfs_commit_unstable_pages
assumes this is all or none, and count is going to be off.

Signed-off-by: Fred Isaman <iisaman@xxxxxxxxxx>
---
 fs/nfs/nfs4filelayout.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index e0bdbf4..08625a8 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -1027,6 +1027,7 @@ filelayout_commit_pagelist(struct inode *inode, struct list_head *mds_pages,
 	struct nfs_write_data	*data, *tmp;
 	LIST_HEAD(list);
 	unsigned int nreq = 0;
+	int status = PNFS_ATTEMPTED;
 
 	if (!list_empty(mds_pages)) {
 		data = nfs_commitdata_alloc();
@@ -1042,6 +1043,7 @@ filelayout_commit_pagelist(struct inode *inode, struct list_head *mds_pages,
 
 	if (nreq == 0) {
 		nfs_commit_clear_lock(NFS_I(inode));
+		status = -ENOMEM;
 		goto out;
 	}
 
@@ -1059,7 +1061,7 @@ filelayout_commit_pagelist(struct inode *inode, struct list_head *mds_pages,
 		}
 	}
 out:
-	return PNFS_ATTEMPTED;
+	return status;
 }
 
 static void
-- 
1.7.2.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