Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-7267

e2fsck kill all files with Large EA.

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • Lustre 2.8.0
    • Lustre 2.8.0
    • None
    • e2fsck 1.42.12 (and looks 1.42.13)
    • 3
    • 9223372036854775807

    Description

      e2fsck start a killing any Large EA enabled files after wrong merging in 1.42.9 e2fsprogs.
      after it point any run e2fsck produce an output

      Pass 1: Checking inodes, blocks, and sizes
      Extended attribute in inode 755994480 has a value size (5674) which is invalid
      

      fix is simple - just restore old behavior in pass1.c : check_ea_in_inode() function.

                      /* check value size */
      -                if (entry->e_value_size > remain) {
      +               if (entry->e_value_size == 0) {
                              pctx->num = entry->e_value_size;
                              problem = PR_1_ATTR_VALUE_SIZE;
                              goto fix;
                      }
       
                      if (entry->e_value_inum == 0) {
                              /* check value size */
                              if (entry->e_value_size > remain) {
                                      pctx->num = entry->e_value_size;
                                      problem = PR_1_ATTR_VALUE_SIZE;
                                      goto fix;
                              }
      

      Attachments

        Activity

          [LU-7267] e2fsck kill all files with Large EA.

          Close this ticket, as we also need to land LU-7368 as well and we can use that for tracking.

          adilger Andreas Dilger added a comment - Close this ticket, as we also need to land LU-7368 as well and we can use that for tracking.

          Patch is landed, but still need to make a new e2fsprogs release with this patch included.

          adilger Andreas Dilger added a comment - Patch is landed, but still need to make a new e2fsprogs release with this patch included.

          Andreas Dilger (andreas.dilger@intel.com) merged in patch http://review.whamcloud.com/16779/
          Subject: LU-7267 e2fsck: remove duplicated ea value size check
          Project: tools/e2fsprogs
          Branch: master-lustre
          Current Patch Set:
          Commit: 709edd7febe7831c01c406cc1552b7c288502a8b

          gerrit Gerrit Updater added a comment - Andreas Dilger (andreas.dilger@intel.com) merged in patch http://review.whamcloud.com/16779/ Subject: LU-7267 e2fsck: remove duplicated ea value size check Project: tools/e2fsprogs Branch: master-lustre Current Patch Set: Commit: 709edd7febe7831c01c406cc1552b7c288502a8b

          Niu, I was looking at the f_large_ea/image file, and it does appear to have large xattrs:

          e2fsck -fn image
          :
          :
          Pass 1: Checking inodes, blocks, and sizes
          Inode 12 has invalid extended attribute. EA inode 79 missing EA_INODE flag.
          Clear? yes
          
          Invalid backpointer from extended attribute inode 19 to parent inode 13.
          Clear? yes
          
          Inode 14 has invalid extended attribute. EA inode 20 missing EA_INODE flag.
          Clear? yes
          
          debugfs:  stat <19>
          Inode: 19   Type: regular    Mode:  0600   Flags: 0x280000
          Generation: 3943742063    Version: 0x00000001
          User:     0   Group:     0   Size: 65536
          File ACL: 0    Directory ACL: 0
          Links: 1   Blockcount: 128
          Fragment:  Address: 0    Number: 0    Size: 0
          ctime: 0x49193fdf -- Tue Nov 11 01:18:39 2008
          atime: 0x49193fdf -- Tue Nov 11 01:18:39 2008
          mtime: 0x0000000f -- Wed Dec 31 17:00:15 1969
          EXTENTS:
          (0-14):1567-1581, (15-63):1261-1309
          
          adilger Andreas Dilger added a comment - Niu, I was looking at the f_large_ea/image file, and it does appear to have large xattrs: e2fsck -fn image : : Pass 1: Checking inodes, blocks, and sizes Inode 12 has invalid extended attribute. EA inode 79 missing EA_INODE flag. Clear? yes Invalid backpointer from extended attribute inode 19 to parent inode 13. Clear? yes Inode 14 has invalid extended attribute. EA inode 20 missing EA_INODE flag. Clear? yes debugfs: stat <19> Inode: 19 Type: regular Mode: 0600 Flags: 0x280000 Generation: 3943742063 Version: 0x00000001 User: 0 Group: 0 Size: 65536 File ACL: 0 Directory ACL: 0 Links: 1 Blockcount: 128 Fragment: Address: 0 Number: 0 Size: 0 ctime: 0x49193fdf -- Tue Nov 11 01:18:39 2008 atime: 0x49193fdf -- Tue Nov 11 01:18:39 2008 mtime: 0x0000000f -- Wed Dec 31 17:00:15 1969 EXTENTS: (0-14):1567-1581, (15-63):1261-1309

          Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/16779
          Subject: LU-7267 e2fsck: remove duplicated ea value size check
          Project: tools/e2fsprogs
          Branch: master-lustre
          Current Patch Set: 1
          Commit: d2498fe35d2a12ef085f865f2edc9350a8b47f2b

          gerrit Gerrit Updater added a comment - Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/16779 Subject: LU-7267 e2fsck: remove duplicated ea value size check Project: tools/e2fsprogs Branch: master-lustre Current Patch Set: 1 Commit: d2498fe35d2a12ef085f865f2edc9350a8b47f2b

          I was wrong about the large ea tests, the ea inode was checked when checking extend attribute blocks, so just removing the duplicated checking code in check_ea_in_inode() should be enough.

          niu Niu Yawei (Inactive) added a comment - I was wrong about the large ea tests, the ea inode was checked when checking extend attribute blocks, so just removing the duplicated checking code in check_ea_in_inode() should be enough.

          Andreas, I found that there is a test for the large xattr:

          commit c204ac83b8889a81d8aeb2ea421ca14db796e5c6
          Author: Andreas Dilger <andreas.dilger@intel.com>
          Date:   Fri Apr 13 02:14:16 2012 -0600
          
              tests: verify large xattr inode support
          
              Verify that inodes with large EAs in a secondary inode are working:
              * EA inode needs to have EA_INODE_FL set
              * EA inode should reference parent inode number+generation
          
              Signed-off-by: Kalpak Shah <kalpak@sun.com>
              Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
          

          But when I check into the image file under f_large_ea, seems none of the files have any xattr set (getfattr can't list any ea entries), and the inode size in the superblock is 128 (which is EXT2_GOOD_OLD_INODE_SIZE), so the check_ea_in_inode() won't be called at all.

          The troublesome here is that EA can be set on fs with 128 inode size (with EA_INODE enabled)? Looks a lot more changes are required to check large ea inode. (see check_inode_extra_space(), check_ea_in_inode()).

          niu Niu Yawei (Inactive) added a comment - Andreas, I found that there is a test for the large xattr: commit c204ac83b8889a81d8aeb2ea421ca14db796e5c6 Author: Andreas Dilger <andreas.dilger@intel.com> Date: Fri Apr 13 02:14:16 2012 -0600 tests: verify large xattr inode support Verify that inodes with large EAs in a secondary inode are working: * EA inode needs to have EA_INODE_FL set * EA inode should reference parent inode number+generation Signed-off-by: Kalpak Shah <kalpak@sun.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> But when I check into the image file under f_large_ea, seems none of the files have any xattr set (getfattr can't list any ea entries), and the inode size in the superblock is 128 (which is EXT2_GOOD_OLD_INODE_SIZE), so the check_ea_in_inode() won't be called at all. The troublesome here is that EA can be set on fs with 128 inode size (with EA_INODE enabled)? Looks a lot more changes are required to check large ea inode. (see check_inode_extra_space(), check_ea_in_inode()).

          There must be a wrong merge at some point which created this duplicated check, probably when merging the 10fc3a63d9b7efb14e810ee94ad1d2f254d44eae (the fix mentioned by Alexey above)

                         /* check value size */
                          if (entry->e_value_size > remain) {
                                  pctx->num = entry->e_value_size;
                                  problem = PR_1_ATTR_VALUE_SIZE;
                                  goto fix;
                          }
          
                          if (entry->e_value_inum == 0) {
                                  /* check value size */
                                  if (entry->e_value_size > remain) {
                                          pctx->num = entry->e_value_size;
                                          problem = PR_1_ATTR_VALUE_SIZE;
                                          goto fix;
                                  }
                          } else {
                                  int ret, tmp;
          
                                  ret = check_large_ea_inode(ctx, entry, pctx, &tmp);
                                  if (ret == 0)
                                          mark_inode_ea_map(ctx, pctx,
                                                            entry->e_value_inum);
                          }
          

          Obviously, the duplicated check above the " if (entry->e_value_inum == 0) " should be completely removed.

          niu Niu Yawei (Inactive) added a comment - There must be a wrong merge at some point which created this duplicated check, probably when merging the 10fc3a63d9b7efb14e810ee94ad1d2f254d44eae (the fix mentioned by Alexey above) /* check value size */ if (entry->e_value_size > remain) { pctx->num = entry->e_value_size; problem = PR_1_ATTR_VALUE_SIZE; goto fix; } if (entry->e_value_inum == 0) { /* check value size */ if (entry->e_value_size > remain) { pctx->num = entry->e_value_size; problem = PR_1_ATTR_VALUE_SIZE; goto fix; } } else { int ret, tmp; ret = check_large_ea_inode(ctx, entry, pctx, &tmp); if (ret == 0) mark_inode_ea_map(ctx, pctx, entry->e_value_inum); } Obviously, the duplicated check above the " if (entry->e_value_inum == 0) " should be completely removed.

          was wrong about checking to zero, we need a kill first check completely. corresponded commit in upstream.

          Author: Eric Sandeen <sandeen@redhat.com>
          Date:   Thu Apr 25 00:14:33 2013 -0400
          
              e2fsprogs: allow 0-length xattr values in e2fsck
              
              e2fsck thinks that this:
              
              # touch mnt/testfile1
              # setfattr -n "user.test" mnt/testfile1
              
              results in a filesystem with corruption:
              
              Pass 1: Checking inodes, blocks, and sizes
              Extended attribute in inode 12 has a value size (0) which is invalid
              Clear? yes
              
              but as far as I can tell, there is absolutely nothing wrong with
              a 0-length value on an extended attribute.  Just remove the check.
              
              Reported-by: David Shaw <dshaw@jabberwocky.com>
              Reported-by: Harald Reindl <h.reindl@thelounge.net>
              Addresses-Red-Hat-Bugzilla: #557959
              Signed-off-by: Eric Sandeen <sandeen@redhat.com>
              Signed-off-by: Theodore Ts'o <tytso@mit.edu>
          
          shadow Alexey Lyashkov added a comment - was wrong about checking to zero, we need a kill first check completely. corresponded commit in upstream. Author: Eric Sandeen <sandeen@redhat.com> Date: Thu Apr 25 00:14:33 2013 -0400 e2fsprogs: allow 0-length xattr values in e2fsck e2fsck thinks that this: # touch mnt/testfile1 # setfattr -n "user.test" mnt/testfile1 results in a filesystem with corruption: Pass 1: Checking inodes, blocks, and sizes Extended attribute in inode 12 has a value size (0) which is invalid Clear? yes but as far as I can tell, there is absolutely nothing wrong with a 0-length value on an extended attribute. Just remove the check. Reported-by: David Shaw <dshaw@jabberwocky.com> Reported-by: Harald Reindl <h.reindl@thelounge.net> Addresses-Red-Hat-Bugzilla: #557959 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>

          Hi Niu,
          Can you have a look at this one?
          Thanks.
          Joe

          jgmitter Joseph Gmitter (Inactive) added a comment - Hi Niu, Can you have a look at this one? Thanks. Joe

          People

            niu Niu Yawei (Inactive)
            shadow Alexey Lyashkov
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: