Re: [PATCH] ext3/4: fix uninitialized bs in ext3/4_xattr_set_handle()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andreas Dilger
Date: Tuesday, May 13, 2008 - 1:00 pm

On May 13, 2008  10:31 +0800, Tiger Yang wrote:

Tiger, thanks for finding this bug, and the patch (which fixes the
problem in our testing).

Signed-off-by: Andreas Dilger <adilger@sun.com>


The EAs in the external block (except the one being added) are lost, and
some blocks (or shared EA block references) are leaked.  In most cases
this is not fatal, but for Lustre I developed a test case where this
causes the file data to be lost (because the file layout is stored in
the external block if it is too large to store in the inode).


Code inspection shows this bug goes back to when the fast EA-in-inode
support was added to the vanilla kernel, at least 2.6.12 (when Git
history begins).

Sadly, the bug was NOT in the original CFS EA-in-inode patches that we
made for kernels 2.6.5 (SLES 9) and 2.6.9 (RHEL 4) (and still use today)
that were in 2.6.11-rc1-mm1, but were added during the later rewrite of
this code.

I suspect the reasons this bug hasn't been reported even when large inodes
are enabled (which is the default for newer e2fsprogs) are:
- it uncommon to have multiple EAs on a file (usually SELinux is the
  only common one and it is relatively small)
- one of the EAs must already be too large to fit in the inode 
- increasing the size of any EA after it is created is rare

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] ext3/4: fix uninitialized bs in ext3/4_xattr_s ..., Andreas Dilger, (Tue May 13, 1:00 pm)
Re: [PATCH] ext3/4: fix uninitialized bs in ext3/4_xattr_s ..., Andreas Gruenbacher, (Wed May 14, 3:56 am)