Bug 434893 - resizing leads to missing xattrs
Summary: resizing leads to missing xattrs
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: e2fsprogs
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F9Beta
TreeView+ depends on / blocked
 
Reported: 2008-02-26 02:41 UTC by Jeremy Katz
Modified: 2008-03-04 03:25 UTC (History)
2 users (show)

Fixed In Version: 1.40.7-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-04 03:25:29 UTC


Attachments (Terms of Use)
patch sent upstream (2.47 KB, patch)
2008-02-28 19:33 UTC, Eric Sandeen
no flags Details | Diff

Description Jeremy Katz 2008-02-26 02:41:35 UTC
Doing the resize as part of the livecd build process with e2fsprogs-1.40.6 leads
to corrupted xattrs on the filesystem and the live image not booting with
selinux enabled.  If I fall back to 1.40.2 from F8 (or disable the resize), then
it works fine

Comment 1 Eric Sandeen 2008-02-26 07:10:44 UTC
Jeremy, could you create an e2image of the filesystem, before & after the resize?

If you bzip2 it it shouldn't be too big...

If it's a hassle I can try to reproduce on my own.

Comment 2 Jeremy Katz 2008-02-26 14:28:50 UTC
I can try to get one in a little bit... it might be a tad tricky given the way
the images are built.  
  livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks
gets you a livecd with the resize done.

Comment 3 Eric Sandeen 2008-02-26 19:26:38 UTC
So, it appears that the end result is actually *missing* selinux xattrs, rather
than corrupted, per se.  Some files have the proper xattrs on disk; others have
none.

Comment 4 Jeremy Katz 2008-02-26 23:03:46 UTC
And per discussion on IRC, I tried creating the filesystem with -I128 and things
were fine then.

Comment 5 Eric Sandeen 2008-02-27 00:41:54 UTC
(oops sorry for fat-fingering the summary)  :)


quick non-livecd-creator test:

#!/bin/bash

dd if=/dev/zero of=fsfile bs=1M count=100
mkfs.ext3 -I 256 -F fsfile
mount -o loop,user_xattr fsfile mnt
for I in `seq 1 1000`; do dd if=/dev/zero bs=128k count=1 of=mnt/file$I;
setfattr -n user.name -v value$I mnt/file$I 2>/dev/null; done
for I in `seq 1 800`; do rm -f mnt/file$I; done
getfattr -n user.name mnt/file82?
umount mnt
e2fsck -f fsfile
resize2fs fsfile 6M
resize2fs fsfile 5M
resize2fs fsfile 4M
mount -o loop,user_xattr fsfile mnt
getfattr -n user.name mnt/file82?
umount mnt

it appears that when resize2fs needs to move inodes, it leaves in-inode xattrs
behind.  Oops.

Comment 6 Eric Sandeen 2008-02-27 01:14:08 UTC
Ok, I see what's up here... will get it patched up shortly.

larger inodes with in-inode xattrs will lose and/or corrupt the xattrs whenever
the inodes are moved in the process of shrinking.

Comment 7 Eric Sandeen 2008-02-28 19:33:50 UTC
Created attachment 296249 [details]
patch sent upstream

I sent a regression test for this, too...

Comment 8 Eric Sandeen 2008-02-29 16:40:14 UTC
On its way to rawhide via e2fsprogs-1.40.7-1

Comment 9 Jeremy Katz 2008-03-01 02:23:33 UTC
Regular files look to be okay with 1.40.7-1, but symlinks still seem to come out
with missing xattrs

Comment 10 Eric Sandeen 2008-03-01 02:58:22 UTC
were the link targets long or short... and did they have missing or wrong
attributes?  Trying to reproduce here...

Comment 11 Eric Sandeen 2008-03-01 03:17:20 UTC
oh and were the attrs on the symlinks or their targets...?

Comment 12 Eric Sandeen 2008-03-04 03:25:29 UTC
Once more, with feeling.  e2fsprogs-1.40.7-2 should fix it, building now.


I tested livecd creation as far as getting an image, fsck'ing it, and checking
that the symlinks all had their attrs... hope it's good this time :)

-Eric


Note You need to log in before you can comment on or make changes to this bug.