All of lore.kernel.org
 help / color / mirror / Atom feed
* why are WB_SYNC_NONE COMMITs being done with FLUSH_SYNC set ?
@ 2010-08-19 14:15 Jeff Layton
       [not found] ` <20100819101525.076831ad-xSBYVWDuneFaJnirhKH9O4GKTjYczspe@public.gmane.org>
  0 siblings, 1 reply; 47+ messages in thread
From: Jeff Layton @ 2010-08-19 14:15 UTC (permalink / raw)
  To: linux-nfs

I'm looking at backporting some upstream changes to earlier kernels,
and ran across something I don't quite understand...

In nfs_commit_unstable_pages, we set the flags to FLUSH_SYNC. We then
zero out the flags if wbc->nonblocking or wbc->for_background is set.

Shouldn't we also clear it out if wbc->sync_mode == WB_SYNC_NONE ?
WB_SYNC_NONE means "don't wait on anything", so shouldn't that include
not waiting on the COMMIT to complete?

For discussion purposes, here's a patch that shows what I'm talking
about (completely untested):

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 874972d..2fca906 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1440,7 +1440,8 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr
 	    nfsi->ncommit <= (nfsi->npages >> 1))
 		goto out_mark_dirty;
 
-	if (wbc->nonblocking || wbc->for_background)
+	if (wbc->nonblocking || wbc->for_background ||
+	    wbc->sync_mode == WB_SYNC_NONE)
 		flags = 0;
 	ret = nfs_commit_inode(inode, flags);
 	if (ret >= 0) {

-- 
Jeff Layton <jlayton@redhat.com>

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

end of thread, other threads:[~2010-08-30 23:53 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-19 14:15 why are WB_SYNC_NONE COMMITs being done with FLUSH_SYNC set ? Jeff Layton
     [not found] ` <20100819101525.076831ad-xSBYVWDuneFaJnirhKH9O4GKTjYczspe@public.gmane.org>
2010-08-19 14:37   ` Christoph Hellwig
2010-08-19 14:37     ` Christoph Hellwig
2010-08-19 14:37     ` Christoph Hellwig
2010-08-19 14:58     ` Trond Myklebust
2010-08-19 14:58       ` Trond Myklebust
2010-08-19 15:11       ` Jeff Layton
2010-08-19 15:11         ` Jeff Layton
     [not found]       ` <1282229905.6199.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-08-19 15:24         ` Christoph Hellwig
2010-08-19 15:24           ` Christoph Hellwig
2010-08-19 15:24           ` Christoph Hellwig
2010-08-19 19:16         ` Jeff Layton
2010-08-19 19:16           ` Jeff Layton
2010-08-19 19:16           ` Jeff Layton
     [not found]           ` <20100819151618.5f769dc9-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-08-19 19:43             ` Trond Myklebust
2010-08-19 19:43               ` Trond Myklebust
2010-08-19 19:43               ` Trond Myklebust
     [not found]               ` <1282246999.7799.66.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-08-20 13:23                 ` Wu Fengguang
2010-08-20 13:23                   ` Wu Fengguang
2010-08-20 13:23                   ` Wu Fengguang
2010-08-30 19:22                   ` Trond Myklebust
2010-08-30 19:22                     ` Trond Myklebust
2010-08-30 19:22                     ` Trond Myklebust
2010-08-30 23:53                     ` Wu Fengguang
2010-08-30 23:53                       ` Wu Fengguang
2010-08-20  0:33           ` Wu Fengguang
2010-08-20  0:33             ` Wu Fengguang
2010-08-20  0:53             ` Jeff Layton
2010-08-20  0:53               ` Jeff Layton
2010-08-20 13:20               ` Wu Fengguang
2010-08-20 13:20                 ` Wu Fengguang
2010-08-19 23:55     ` Wu Fengguang
2010-08-19 23:55       ` Wu Fengguang
2010-08-20  0:02       ` Wu Fengguang
2010-08-20  0:02         ` Wu Fengguang
2010-08-20  2:36         ` Sage Weil
2010-08-20  2:36           ` Sage Weil
2010-08-20  9:19       ` Christoph Hellwig
2010-08-20  9:19         ` Christoph Hellwig
     [not found]         ` <20100820091904.GB20138-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2010-08-20 11:27           ` Jeff Layton
2010-08-20 11:27             ` Jeff Layton
2010-08-20 11:27             ` Jeff Layton
2010-08-20 12:44             ` Wu Fengguang
2010-08-20 12:44               ` Wu Fengguang
2010-08-20 12:26           ` Wu Fengguang
2010-08-20 12:26             ` Wu Fengguang
2010-08-20 12:26             ` Wu Fengguang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.