diff mbox

NFS: return -EAGAIN when skipped commit in nfs_commit_unstable_pages()

Message ID 20110610140459.GA8021@localhost (mailing list archive)
State New, archived
Headers show

Commit Message

Fengguang Wu June 10, 2011, 2:04 p.m. UTC
It's confusing to return success while redirtying the inode at the
same time in ->write_inode(). Return -EAGAIN to indicate that we've
not finished with this inode.

Impact: it's a cleanup, not bug fix.

CC: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 fs/nfs/write.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

Comments

Trond Myklebust June 13, 2011, 7:38 p.m. UTC | #1
On Fri, 2011-06-10 at 22:04 +0800, Wu Fengguang wrote: 
> It's confusing to return success while redirtying the inode at the
> same time in ->write_inode(). Return -EAGAIN to indicate that we've
> not finished with this inode.
> 
> Impact: it's a cleanup, not bug fix.
> 
> CC: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
>  fs/nfs/write.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-next.orig/fs/nfs/write.c	2011-06-10 21:52:34.000000000 +0800
> +++ linux-next/fs/nfs/write.c	2011-06-10 21:52:37.000000000 +0800
> @@ -1521,7 +1521,7 @@ static int nfs_commit_unstable_pages(str
>  {
>  	struct nfs_inode *nfsi = NFS_I(inode);
>  	int flags = FLUSH_SYNC;
> -	int ret = 0;
> +	int ret = -EAGAIN;
>  
>  	if (wbc->sync_mode == WB_SYNC_NONE) {
>  		/* Don't commit yet if this is a non-blocking flush and there

Looks good, but since this is a cleanup, I'm queueing it for 3.1 rather
than pushing it in the regression-fixing window.

Cheers
  Trond
Fengguang Wu June 14, 2011, 2:30 a.m. UTC | #2
> > @@ -1521,7 +1521,7 @@ static int nfs_commit_unstable_pages(str
> >  {
> >  	struct nfs_inode *nfsi = NFS_I(inode);
> >  	int flags = FLUSH_SYNC;
> > -	int ret = 0;
> > +	int ret = -EAGAIN;
> >  
> >  	if (wbc->sync_mode == WB_SYNC_NONE) {
> >  		/* Don't commit yet if this is a non-blocking flush and there
> 
> Looks good, but since this is a cleanup, I'm queueing it for 3.1 rather
> than pushing it in the regression-fixing window.

OK, thanks!

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

Patch

--- linux-next.orig/fs/nfs/write.c	2011-06-10 21:52:34.000000000 +0800
+++ linux-next/fs/nfs/write.c	2011-06-10 21:52:37.000000000 +0800
@@ -1521,7 +1521,7 @@  static int nfs_commit_unstable_pages(str
 {
 	struct nfs_inode *nfsi = NFS_I(inode);
 	int flags = FLUSH_SYNC;
-	int ret = 0;
+	int ret = -EAGAIN;
 
 	if (wbc->sync_mode == WB_SYNC_NONE) {
 		/* Don't commit yet if this is a non-blocking flush and there