linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tao Guo <guotao-U4AKAne5IzAR5TUyvShJeg@public.gmane.org>
To: linux-nfs@vger.kernel.org
Cc: Benny Halevy <bhalevy@panasas.com>,
	"J. Bruce Fields" <bfields@fieldses.org>
Subject: [PATCH] pnfs: call layoutcommit after flushing inode's data to disk.
Date: Thu, 20 May 2010 11:28:08 +0800	[thread overview]
Message-ID: <20100520032759.GA26892@vmware> (raw)

Signed-off-by: Tao Guo <guotao-U4AKAne5IzAR5TUyvShJeg@public.gmane.org>
---
 fs/nfs/write.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index d3e1645..b4f48b2 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1558,6 +1558,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
  */
 int nfs_wb_all(struct inode *inode)
 {
+	int ret;
 	struct writeback_control wbc = {
 		.sync_mode = WB_SYNC_ALL,
 		.nr_to_write = LONG_MAX,
@@ -1565,7 +1566,12 @@ int nfs_wb_all(struct inode *inode)
 		.range_end = LLONG_MAX,
 	};
 
-	return sync_inode(inode, &wbc);
+	ret = sync_inode(inode, &wbc);
+#ifdef CONFIG_NFS_V4_1
+	if (!ret && NFS_I(inode)->layoutcommit_ctx)
+		ret = pnfs_layoutcommit_inode(inode, 1);
+#endif
+	return ret;
 }
 
 int nfs_wb_page_cancel(struct inode *inode, struct page *page)
-- 
1.6.3.3


             reply	other threads:[~2010-05-20  3:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20  3:28 Tao Guo [this message]
2010-05-20  4:42 ` [PATCH] pnfs: call layoutcommit after flushing inode's data to disk Tao Guo
     [not found]   ` <AANLkTikc6JXz1ubKJHxs0UJq-x80Mafsz4SKgkBPZgnf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-20 14:17     ` Andy Adamson
  -- strict thread matches above, loose matches on Subject: below --
2010-05-24 19:04 Boaz Harrosh
2010-05-24 19:06 ` Boaz Harrosh
2010-05-25  6:55   ` Benny Halevy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100520032759.GA26892@vmware \
    --to=guotao-u4akane5izar5tuyvshjeg@public.gmane.org \
    --cc=bfields@fieldses.org \
    --cc=bhalevy@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).