]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Merge branch 'libxfs-4.18-sync' into for-next
authorEric Sandeen <sandeen@redhat.com>
Fri, 27 Jul 2018 22:10:26 +0000 (17:10 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 27 Jul 2018 22:10:26 +0000 (17:10 -0500)
libxfs/xfs_alloc.c
libxfs/xfs_inode_buf.c

index 20b714121e438625d08d4b25ffe972bfb088fab2..5ead56d290a317934d4c39119d78b0782e011a75 100644 (file)
@@ -219,12 +219,13 @@ xfs_alloc_get_rec(
        error = xfs_btree_get_rec(cur, &rec, stat);
        if (error || !(*stat))
                return error;
-       if (rec->alloc.ar_blockcount == 0)
-               goto out_bad_rec;
 
        *bno = be32_to_cpu(rec->alloc.ar_startblock);
        *len = be32_to_cpu(rec->alloc.ar_blockcount);
 
+       if (*len == 0)
+               goto out_bad_rec;
+
        /* check for valid extent range, including overflow */
        if (!xfs_verify_agbno(mp, agno, *bno))
                goto out_bad_rec;
index 5025f6a1e75d9ae7d0a2c67a30c3774b58cbb3dd..03ab18bb1f6098a6c12f2e68d8d2a980ec61af96 100644 (file)
@@ -727,7 +727,8 @@ xfs_inode_validate_extsize(
        if ((hint_flag || inherit_flag) && extsize == 0)
                return __this_address;
 
-       if (!(hint_flag || inherit_flag) && extsize != 0)
+       /* free inodes get flags set to zero but extsize remains */
+       if (mode && !(hint_flag || inherit_flag) && extsize != 0)
                return __this_address;
 
        if (extsize_bytes % blocksize_bytes)
@@ -773,7 +774,8 @@ xfs_inode_validate_cowextsize(
        if (hint_flag && cowextsize == 0)
                return __this_address;
 
-       if (!hint_flag && cowextsize != 0)
+       /* free inodes get flags set to zero but cowextsize remains */
+       if (mode && !hint_flag && cowextsize != 0)
                return __this_address;
 
        if (hint_flag && rt_flag)