]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsprogs: Use 32-bit variant of ext2fs_swab to read i_projid
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Wed, 23 May 2018 03:22:07 +0000 (08:52 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 24 May 2018 21:28:33 +0000 (17:28 -0400)
i_projid is a 32-bit field of the inode. Hence this commit uses
ext2fs_swab32() to convert the i_projid field from the on-disk little
endian format to the host cpu format. Without this change, project quota
consistency check used to fail on big endian powerpc systems.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
lib/ext2fs/swapfs.c

index 0cf5f9a5da3a50578050768de5eac3bf8b877129..b168a2f202081cf437c8eb927da27679513f4051 100644 (file)
@@ -357,7 +357,7 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
        if (inode_includes(inode_size, i_version_hi))
                t->i_version_hi = ext2fs_swab32(f->i_version_hi);
        if (inode_includes(inode_size, i_projid))
-                t->i_projid = ext2fs_swab16(f->i_projid);
+                t->i_projid = ext2fs_swab32(f->i_projid);
        /* catch new static fields added after i_projid */
        EXT2FS_BUILD_BUG_ON(sizeof(struct ext2_inode_large) != 160);