From e1c9af1edac26b1d05492ccb1e5fb1dbe59cc649 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Tue, 9 Oct 2012 14:50:52 +1100 Subject: [PATCH] --- yaml --- r: 335455 b: refs/heads/master c: eaef854335ce09956e930fe4a193327417edc6c9 h: refs/heads/master i: 335453: 1c44fcbc377d5c027321d00805bbd54762960e98 335451: d7c5ccae3740f913ed14c65433160a65f1370a85 335447: cd8d764780288e70fe341974be3b4d32c3e71ed4 335439: b4547d940605b213eedf145eb2d28a81e7134bd0 335423: 5bdfeff28e87479602c6f8a86c050ec2b5fc45ac v: v3 --- [refs] | 2 +- trunk/fs/xfs/xfs_fsops.c | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 3e863174b577..7610b0c4d77e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1f3c785c3adb7d2b109ec7c8f10081d1294b03d3 +refs/heads/master: eaef854335ce09956e930fe4a193327417edc6c9 diff --git a/trunk/fs/xfs/xfs_fsops.c b/trunk/fs/xfs/xfs_fsops.c index c25b094efbf7..4beaede43277 100644 --- a/trunk/fs/xfs/xfs_fsops.c +++ b/trunk/fs/xfs/xfs_fsops.c @@ -399,9 +399,26 @@ xfs_growfs_data_private( /* update secondary superblocks. */ for (agno = 1; agno < nagcount; agno++) { - error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, + error = 0; + /* + * new secondary superblocks need to be zeroed, not read from + * disk as the contents of the new area we are growing into is + * completely unknown. + */ + if (agno < oagcount) { + error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), XFS_FSS_TO_BB(mp, 1), 0, &bp); + } else { + bp = xfs_trans_get_buf(NULL, mp->m_ddev_targp, + XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), + XFS_FSS_TO_BB(mp, 1), 0); + if (bp) + xfs_buf_zero(bp, 0, BBTOB(bp->b_length)); + else + error = ENOMEM; + } + if (error) { xfs_warn(mp, "error %d reading secondary superblock for ag %d", @@ -423,7 +440,7 @@ xfs_growfs_data_private( break; /* no point in continuing */ } } - return 0; + return error; error0: xfs_trans_cancel(tp, XFS_TRANS_ABORT);