From patchwork Tue Nov 17 17:46:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/2] ext2: add wait flag support to sync_fs Date: Tue, 17 Nov 2009 07:46:19 -0000 From: stephen hemminger X-Patchwork-Id: 38667 Message-Id: <20091117174647.402219318@vyatta.com> To: linux-ext4@vger.kernel.org Make ext2 safer against accidental data loss during removal by adding support for waiting for super block update on sync. Don't know why this wasn't done originally, all the other file systems have it. Signed-off-by: Stephen Hemminger --- a/fs/ext2/super.c 2009-11-17 09:14:12.177002522 -0800 +++ b/fs/ext2/super.c 2009-11-17 09:14:32.698005421 -0800 @@ -1147,6 +1147,8 @@ static int ext2_sync_fs(struct super_blo ext2_sync_super(sb, es); } else { ext2_commit_super(sb, es); + if (wait) + sync_dirty_buffer(EXT2_SB(sb)->s_sbh); } sb->s_dirt = 0; unlock_kernel();