From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryusuke Konishi Subject: Re: [PATCH 07/15] nilfs2: replace barriers with explicit flush / FUA usage Date: Wed, 18 Aug 2010 22:31:33 +0900 (JST) Message-ID: <20100818.223133.257688698.ryusuke@osrg.net> References: <20100818093432.646633424@bombadil.infradead.org> <20100818093501.008646608@bombadil.infradead.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: tj@kernel.org, chris.mason@oracle.com, swhiteho@redhat.com, konishi.ryusuke@lab.ntt.co.jp, tytso@mit.edu, jack@suse.cz, hirofumi@mail.parknet.co.jp, mfasheh@suse.com, joel.becker@oracle.com, hughd@google.com, linux-fsdevel@vger.kernel.org To: hch@infradead.org Return-path: Received: from sh.osrg.net ([192.16.179.4]:58526 "EHLO sh.osrg.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752981Ab0HRNed (ORCPT ); Wed, 18 Aug 2010 09:34:33 -0400 In-Reply-To: <20100818093501.008646608@bombadil.infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 18 Aug 2010 05:29:15 -0400, Christoph Hellwig wrote: > Switch to the WRITE_FLUSH_FUA flag for log writes, remove the EOPNOTSUPP > detection for barriers and stop setting the barrier flag for discards. > > XXX: nilfs2 does not actually wait for discards to finish, so the code > after this patch is almost guaranteed to be incorrect when dicards are > used. > > Signed-off-by: Christoph Hellwig Ahh, actually discards in nilfs missed adoption of wait semantics, and should be corrected. May I send up the following fix on ahead ? As for the rest, the patch looks ok to me. Acked-by: Ryusuke Konishi Thanks, Ryusuke Konishi --- From: Ryusuke Konishi nilfs2: wait for discard to finish nilfs_discard_segment() doesn't wait for completion of discard requests. This specifies BLKDEV_IFL_WAIT flag when calling blkdev_issue_discard() in order to fix the sync failure. Signed-off-by: Ryusuke Konishi Cc: Christoph Hellwig --- fs/nilfs2/the_nilfs.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index 6af1c00..4317f17 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c @@ -775,6 +775,7 @@ int nilfs_discard_segments(struct the_nilfs *nilfs, __u64 *segnump, start * sects_per_block, nblocks * sects_per_block, GFP_NOFS, + BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); if (ret < 0) return ret; @@ -785,7 +786,8 @@ int nilfs_discard_segments(struct the_nilfs *nilfs, __u64 *segnump, ret = blkdev_issue_discard(nilfs->ns_bdev, start * sects_per_block, nblocks * sects_per_block, - GFP_NOFS, BLKDEV_IFL_BARRIER); + GFP_NOFS, + BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); return ret; } -- 1.6.6.2