]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_repair: join realtime inodes to transaction only once
authorEric Sandeen <sandeen@redhat.com>
Fri, 28 Feb 2020 04:20:42 +0000 (23:20 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 28 Feb 2020 04:20:42 +0000 (23:20 -0500)
fill_rbmino() and fill_rsumino() can join the inode to the transactions
multiple times before committing, which is not permitted.

This leads to cache purge errors when running repair:

  "cache_purge: shake on cache 0x92f5c0 left 129 nodes!?"

Move the libxfs_trans_ijoin out of the while loop to avoid this.

Fixes: e2dd0e1cc ("libxfs: remove libxfs_trans_iget")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase6.c

index 701356946d91df4580e25d338797df6925f3c337..7bbc6da21b8c3513d1a0fc6840b8a2b03a2b7263 100644 (file)
@@ -645,7 +645,6 @@ fill_rbmino(xfs_mount_t *mp)
                /*
                 * fill the file one block at a time
                 */
-               libxfs_trans_ijoin(tp, ip, 0);
                nmap = 1;
                error = -libxfs_bmapi_write(tp, ip, bno, 1, 0, 1, &map, &nmap);
                if (error || nmap != 1) {
@@ -676,6 +675,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime bitmap inode %
                bno++;
        }
 
+       libxfs_trans_ijoin(tp, ip, 0);
        error = -libxfs_trans_commit(tp);
        if (error)
                do_error(_("%s: commit failed, error %d\n"), __func__, error);
@@ -716,7 +716,6 @@ fill_rsumino(xfs_mount_t *mp)
                /*
                 * fill the file one block at a time
                 */
-               libxfs_trans_ijoin(tp, ip, 0);
                nmap = 1;
                error = -libxfs_bmapi_write(tp, ip, bno, 1, 0, 1, &map, &nmap);
                if (error || nmap != 1) {
@@ -748,6 +747,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode
                bno++;
        }
 
+       libxfs_trans_ijoin(tp, ip, 0);
        error = -libxfs_trans_commit(tp);
        if (error)
                do_error(_("%s: commit failed, error %d\n"), __func__, error);