Whamcloud - gitweb
Fix up extended attribute handling in e2image, resize2fs, and in
authorTheodore Ts'o <tytso@mit.edu>
Fri, 16 Aug 2002 21:03:59 +0000 (17:03 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 16 Aug 2002 21:03:59 +0000 (17:03 -0400)
debugfs's icheck command.

debugfs/ChangeLog
debugfs/icheck.c
misc/ChangeLog
misc/e2image.c
resize/ChangeLog
resize/resize2fs.c

index b77a62a..ac5cab1 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-16  Theodore Ts'o  <tytso@mit.edu>
+
+       * icheck.c (do_icheck): Check to see if the block is listed as
+               part of the extended attribute block.
+
 2002-07-21  Theodore Ts'o  <tytso@mit.edu>
 
        * htree.c (do_htree_dump): Fix a bug where we were not cleanly
index 941c749..75044a6 100644 (file)
@@ -41,7 +41,7 @@ static int icheck_proc(ext2_filsys fs,
        e2_blkcnt_t     i;
 
        for (i=0; i < bw->num_blocks; i++) {
-               if (bw->barray[i].blk == *block_nr) {
+               if (!bw->barray[i].ino && bw->barray[i].blk == *block_nr) {
                        bw->barray[i].ino = bw->inode;
                        bw->blocks_left--;
                }
@@ -108,6 +108,13 @@ void do_icheck(int argc, char **argv)
        while (ino) {
                if (!inode.i_links_count)
                        goto next;
+
+               if (inode.i_file_acl) {
+                       icheck_proc(fs, &inode.i_file_acl, 0, 0, 0, &bw);
+                       if (bw.blocks_left == 0)
+                               break;
+               }
+
                if (!ext2fs_inode_has_valid_blocks(&inode))
                        goto next;
                /*
index 0469b71..a10ecc0 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-16  Theodore Ts'o  <tytso@mit.edu>
+
+       * e2image.c (write_raw_image_file): Check for an extended
+               attribute block before checking for has_valid_blocks.
+
 2002-07-21  Theodore Ts'o  <tytso@mit.edu>
 
        * fsck.8.in: Document new fsck exit code, FSCK_CANCELED.
index 8c07b10..db8bd64 100644 (file)
@@ -395,8 +395,13 @@ static void write_raw_image_file(ext2_filsys fs, int fd)
                }
                if (ino == 0)
                        break;
-               if (!inode.i_links_count ||
-                   !ext2fs_inode_has_valid_blocks(&inode))
+               if (!inode.i_links_count)
+                       continue;
+               if (inode.i_file_acl) {
+                       ext2fs_mark_block_bitmap(meta_block_map,
+                                                inode.i_file_acl);
+               }
+               if (!ext2fs_inode_has_valid_blocks(&inode))
                        continue;
                
                stashed_ino = ino;
@@ -423,10 +428,6 @@ static void write_raw_image_file(ext2_filsys fs, int fd)
                                        exit(1);
                                }
                        }
-                       if (inode.i_file_acl) {
-                               ext2fs_mark_block_bitmap(meta_block_map,
-                                                        inode.i_file_acl);
-                       }
                }
        }
        use_inode_shortcuts(fs, 0);
index e9bfd21..3ff6f12 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-16  Theodore Ts'o  <tytso@mit.edu>
+
+       * resize2fs.c (inode_scan_and_fix): Add code to move the extended
+               attribute block.
+       
 2002-07-26  Theodore Ts'o  <tytso@mit.edu>
 
        * resize2fs.c (block_mover): If there are no blocks to move,
index 67caa40..042e562 100644 (file)
@@ -998,6 +998,17 @@ static errcode_t inode_scan_and_fix(ext2_resize_t rfs)
                pb.is_dir = LINUX_S_ISDIR(inode.i_mode);
                pb.changed = 0;
 
+               if (inode.i_file.acl && rfs->bmap) {
+                       new_block = ext2fs_extent_translate(pb->rfs->bmap, 
+                                                           inode.i_file_acl);
+                       if (new_block) {
+                               inode.i_file_acl = new_block;
+                               retval = ext2fs_write_inode(rfs->old_fs, 
+                                                           ino, &inode);
+                               if (retval) goto errout;
+                       }
+               }
+               
                if (ext2fs_inode_has_valid_blocks(&inode) &&
                    (rfs->bmap || pb.is_dir)) {
                        pb.ino = ino;