linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] nfsd: make sure data is on disk before calling ->fsync
@ 2009-12-25 16:44 Christoph Hellwig
  2010-01-04 13:50 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2009-12-25 16:44 UTC (permalink / raw)
  To: bfields, viro, jack; +Cc: linux-nfs, linux-fsdevel

nfsd is not using vfs_fsync, so I missed it when changing the calling
convention during the 2.6.32 window.  This patch fixes it to not only
start the data writeout, but also wait for it to complete before calling
into ->fsync.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.orig/fs/nfsd/vfs.c	2009-12-25 17:21:32.371024157 +0100
+++ linux-2.6/fs/nfsd/vfs.c	2009-12-25 17:31:39.644006085 +0100
@@ -780,12 +780,9 @@ static inline int nfsd_dosync(struct fil
 	int (*fsync) (struct file *, struct dentry *, int);
 	int err;
 
-	err = filemap_fdatawrite(inode->i_mapping);
+	err = filemap_write_and_wait(inode->i_mapping);
 	if (err == 0 && fop && (fsync = fop->fsync))
 		err = fsync(filp, dp, 0);
-	if (err == 0)
-		err = filemap_fdatawait(inode->i_mapping);
-
 	return err;
 }
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] nfsd: make sure data is on disk before calling ->fsync
  2009-12-25 16:44 [PATCH 1/2] nfsd: make sure data is on disk before calling ->fsync Christoph Hellwig
@ 2010-01-04 13:50 ` Christoph Hellwig
  2010-01-04 20:42   ` J. Bruce Fields
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2010-01-04 13:50 UTC (permalink / raw)
  To: bfields, viro, jack; +Cc: linux-nfs, linux-fsdevel

ping?  this fixes a quite nasty issue introduced in 2.6.32, so we should
fix it ASAP (including backport to -stable)

On Fri, Dec 25, 2009 at 05:44:45PM +0100, Christoph Hellwig wrote:
> nfsd is not using vfs_fsync, so I missed it when changing the calling
> convention during the 2.6.32 window.  This patch fixes it to not only
> start the data writeout, but also wait for it to complete before calling
> into ->fsync.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: linux-2.6/fs/nfsd/vfs.c
> ===================================================================
> --- linux-2.6.orig/fs/nfsd/vfs.c	2009-12-25 17:21:32.371024157 +0100
> +++ linux-2.6/fs/nfsd/vfs.c	2009-12-25 17:31:39.644006085 +0100
> @@ -780,12 +780,9 @@ static inline int nfsd_dosync(struct fil
>  	int (*fsync) (struct file *, struct dentry *, int);
>  	int err;
>  
> -	err = filemap_fdatawrite(inode->i_mapping);
> +	err = filemap_write_and_wait(inode->i_mapping);
>  	if (err == 0 && fop && (fsync = fop->fsync))
>  		err = fsync(filp, dp, 0);
> -	if (err == 0)
> -		err = filemap_fdatawait(inode->i_mapping);
> -
>  	return err;
>  }
>  
---end quoted text---

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] nfsd: make sure data is on disk before calling ->fsync
  2010-01-04 13:50 ` Christoph Hellwig
@ 2010-01-04 20:42   ` J. Bruce Fields
  2010-01-04 20:43     ` J. Bruce Fields
  2010-01-05 15:22     ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: J. Bruce Fields @ 2010-01-04 20:42 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: viro, jack, linux-nfs, linux-fsdevel

On Mon, Jan 04, 2010 at 02:50:45PM +0100, Christoph Hellwig wrote:
> ping?  this fixes a quite nasty issue introduced in 2.6.32, so we should
> fix it ASAP (including backport to -stable)

Apologies for the delay.  Which commit exactly introduced the original
regression?  I'll take over getting them into 2.6.33 and 2.6.32.y unless
you tell me you're already doing that.

--b.

> 
> On Fri, Dec 25, 2009 at 05:44:45PM +0100, Christoph Hellwig wrote:
> > nfsd is not using vfs_fsync, so I missed it when changing the calling
> > convention during the 2.6.32 window.  This patch fixes it to not only
> > start the data writeout, but also wait for it to complete before calling
> > into ->fsync.
> > 
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > 
> > Index: linux-2.6/fs/nfsd/vfs.c
> > ===================================================================
> > --- linux-2.6.orig/fs/nfsd/vfs.c	2009-12-25 17:21:32.371024157 +0100
> > +++ linux-2.6/fs/nfsd/vfs.c	2009-12-25 17:31:39.644006085 +0100
> > @@ -780,12 +780,9 @@ static inline int nfsd_dosync(struct fil
> >  	int (*fsync) (struct file *, struct dentry *, int);
> >  	int err;
> >  
> > -	err = filemap_fdatawrite(inode->i_mapping);
> > +	err = filemap_write_and_wait(inode->i_mapping);
> >  	if (err == 0 && fop && (fsync = fop->fsync))
> >  		err = fsync(filp, dp, 0);
> > -	if (err == 0)
> > -		err = filemap_fdatawait(inode->i_mapping);
> > -
> >  	return err;
> >  }
> >  
> ---end quoted text---

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] nfsd: make sure data is on disk before calling ->fsync
  2010-01-04 20:42   ` J. Bruce Fields
@ 2010-01-04 20:43     ` J. Bruce Fields
  2010-01-05 15:22     ` Christoph Hellwig
  1 sibling, 0 replies; 6+ messages in thread
From: J. Bruce Fields @ 2010-01-04 20:43 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: viro, jack, linux-nfs, linux-fsdevel

On Mon, Jan 04, 2010 at 03:42:06PM -0500, J. Bruce Fields wrote:
> On Mon, Jan 04, 2010 at 02:50:45PM +0100, Christoph Hellwig wrote:
> > ping?  this fixes a quite nasty issue introduced in 2.6.32, so we should
> > fix it ASAP (including backport to -stable)
> 
> Apologies for the delay.  Which commit exactly introduced the original
> regression?  I'll take over getting them into 2.6.33 and 2.6.32.y

(the latter just for the first patch, I'm assuming)

> unless you tell me you're already doing that.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] nfsd: make sure data is on disk before calling ->fsync
  2010-01-04 20:42   ` J. Bruce Fields
  2010-01-04 20:43     ` J. Bruce Fields
@ 2010-01-05 15:22     ` Christoph Hellwig
  2010-01-06 22:46       ` J. Bruce Fields
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2010-01-05 15:22 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Christoph Hellwig, viro, jack, linux-nfs, linux-fsdevel

On Mon, Jan 04, 2010 at 03:42:06PM -0500, J. Bruce Fields wrote:
> On Mon, Jan 04, 2010 at 02:50:45PM +0100, Christoph Hellwig wrote:
> > ping?  this fixes a quite nasty issue introduced in 2.6.32, so we should
> > fix it ASAP (including backport to -stable)
> 
> Apologies for the delay.  Which commit exactly introduced the original
> regression?  I'll take over getting them into 2.6.33 and 2.6.32.y unless
> you tell me you're already doing that.

2daea67e966dc0c42067ebea015ddac6834cef88 changed the calling convention.
Removal of the explicit wait in the filesystem might have been another
few commits.

If you can easily take care of getting the first patch into -stable I'll
leave it to you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] nfsd: make sure data is on disk before calling ->fsync
  2010-01-05 15:22     ` Christoph Hellwig
@ 2010-01-06 22:46       ` J. Bruce Fields
  0 siblings, 0 replies; 6+ messages in thread
From: J. Bruce Fields @ 2010-01-06 22:46 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: viro, jack, linux-nfs, linux-fsdevel

On Tue, Jan 05, 2010 at 04:22:31PM +0100, Christoph Hellwig wrote:
> On Mon, Jan 04, 2010 at 03:42:06PM -0500, J. Bruce Fields wrote:
> > On Mon, Jan 04, 2010 at 02:50:45PM +0100, Christoph Hellwig wrote:
> > > ping?  this fixes a quite nasty issue introduced in 2.6.32, so we should
> > > fix it ASAP (including backport to -stable)
> > 
> > Apologies for the delay.  Which commit exactly introduced the original
> > regression?  I'll take over getting them into 2.6.33 and 2.6.32.y unless
> > you tell me you're already doing that.
> 
> 2daea67e966dc0c42067ebea015ddac6834cef88 changed the calling convention.
> Removal of the explicit wait in the filesystem might have been another
> few commits.
> 
> If you can easily take care of getting the first patch into -stable I'll
> leave it to you.

OK, thanks, done.  And the other patch queued up for 2.6.34.

--b.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-06 22:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-25 16:44 [PATCH 1/2] nfsd: make sure data is on disk before calling ->fsync Christoph Hellwig
2010-01-04 13:50 ` Christoph Hellwig
2010-01-04 20:42   ` J. Bruce Fields
2010-01-04 20:43     ` J. Bruce Fields
2010-01-05 15:22     ` Christoph Hellwig
2010-01-06 22:46       ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).