]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: clear extent size hints when clearing inode core
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 28 Jun 2018 20:09:21 +0000 (15:09 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:09:21 +0000 (15:09 -0500)
In kernel 4.18 we become more strict about what can be in the extent
size hint fields, even for freed inodes.  Therefore, if repair decides
to clear out an inode core, zero the hint fields and clear the flags so
that the kernel won't trip over the cleared inode if and when it tries
to read the chunk.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/dinode.c

index 49d5d058ac4794a9b66ceb31cb61da108e6eb5fd..72e09cc994a866bfd678f1190d6be5dc9811fd9e 100644 (file)
@@ -194,6 +194,11 @@ clear_dinode_core(struct xfs_mount *mp, xfs_dinode_t *dinoc, xfs_ino_t ino_num)
                dinoc->di_anextents = 0;
        }
 
+       if (be32_to_cpu(dinoc->di_extsize) != 0)  {
+               __dirty_no_modify_ret(dirty);
+               dinoc->di_extsize = 0;
+       }
+
        if (dinoc->di_version > 1 &&
                        be32_to_cpu(dinoc->di_nlink) != 0)  {
                __dirty_no_modify_ret(dirty);
@@ -237,6 +242,11 @@ clear_dinode_core(struct xfs_mount *mp, xfs_dinode_t *dinoc, xfs_ino_t ino_num)
                dinoc->di_changecount = 0;
        }
 
+       if (be32_to_cpu(dinoc->di_cowextsize) != 0)  {
+               __dirty_no_modify_ret(dirty);
+               dinoc->di_cowextsize = 0;
+       }
+
        return dirty;
 }