xfs: growfs should use synchronous transactions
authorChristoph Hellwig <hch@lst.de>
Thu, 5 Feb 2015 00:13:21 +0000 (11:13 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 5 Feb 2015 00:13:21 +0000 (11:13 +1100)
Growfs updates the secondary superblocks using synchronous unlogged
buffer writes after committing the updates to the primary superblock.

Mark the transaction to the primary superblock as synchronous so that
we guarantee it is committed to disk before we update the secondary
superblocks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_fsops.c

index f7114527cd2f82cd51c8145ea2f27f36b5120e35..fba6532efba44d0d7114baa24e358716aeb3c922 100644 (file)
@@ -488,6 +488,7 @@ xfs_growfs_data_private(
                xfs_trans_mod_sb(tp, XFS_TRANS_SB_FDBLOCKS, nfree);
        if (dpct)
                xfs_trans_mod_sb(tp, XFS_TRANS_SB_IMAXPCT, dpct);
+       xfs_trans_set_sync(tp);
        error = xfs_trans_commit(tp, 0);
        if (error)
                return error;