Whamcloud - gitweb
libext2fs: fix 64-bit support in ext2fs_{read,write}_inode_full() 25/1325/1
authorTheodore Ts'o <tytso@mit.edu>
Wed, 6 Jul 2011 00:02:27 +0000 (20:02 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 1 Sep 2011 23:18:27 +0000 (17:18 -0600)
This fixes a problem where reading or writing inodes located after the
4GB boundary would fail.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/inode.c

index a762dbc..829e032 100644 (file)
@@ -522,7 +522,8 @@ errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino,
 errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,
                                 struct ext2_inode * inode, int bufsize)
 {
-       unsigned long   group, block, block_nr, offset;
+       blk64_t         block_nr;
+       unsigned long   group, block, offset;
        char            *ptr;
        errcode_t       retval;
        int             clen, i, inodes_per_block, length;
@@ -628,7 +629,8 @@ errcode_t ext2fs_read_inode(ext2_filsys fs, ext2_ino_t ino,
 errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,
                                  struct ext2_inode * inode, int bufsize)
 {
-       unsigned long group, block, block_nr, offset;
+       blk64_t block_nr;
+       unsigned long group, block, offset;
        errcode_t retval = 0;
        struct ext2_inode_large temp_inode, *w_inode;
        char *ptr;