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

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

Post by Andreas Di » Thu, 15 May 2008 05:10:12


n 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 < XXXX@XXXXX.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.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
 
 
 

1. [PATCH 3/5] ext3-get-blocks: support multiple blocks allocation in ext3-new-block()

2. [Patch 2/6]: ext3 reservations: Renumber the ext3 reservations ioctls

Hi,




I don't mind either way. But I just looked, and I think they are doing
different things. If I'm reading the XFS bits right, the XFS ioctls
actively reserve/free disk space; but the ext3 ones do nothing except
set/query the size of the per-inode sliding reservation window.

So sounds like they are best kept separate for now.

Cheers,
Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. [Patch 4/6]: ext3 reservations: Turn ext3 per-sb reservations list into an rbtree.

4. [PATCH 4/5] ext3-get-blocks: Adjust accounting info in ext3-new-blocks()

5. [Patch 2/6]: ext3 reservations: Renumber the ext3 reservations ioctls

6. [Patch 4/6]: ext3 reservations: Turn ext3 per-sb reservations list into an rbtree.

7. [Patch 4/6]: ext3 reservations: Turn ext3 per-sb reservations list into an rbtree.

8. [PATCH] ext3: small fix for previous retries patch in ext3_prepare_write()

9. My Switch Between EXT3 and REISERFS AND EXT3 AND......

10. Linux 2.4.30-rc3 md/ext3 problems (ext3 gurus : please check)

11. ext3 oops with 2.4.21 [Was: ext3 oops]

12. Q: (2.6.16 & ext3) bad SMP load balancing when writing to ext3 on slow device

13. [RFC 4/13] extents and 48bit ext3: convert ext3 filesystem blocks to ext3_fsblk_t

14. Linux 2.4.30-rc3 md/ext3 problems (ext3 gurus : please check)

15. [PATCH] ext3 sparse fixes