aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2017-01-31 14:05:45 -0500
committerTheodore Ts'o <tytso@mit.edu>2017-01-31 14:05:45 -0500
commit47b8941774df6bc134efd6d6051af33391fa3078 (patch)
tree1e91745ba2efe351dc3f7c275e44ec70f6c65ac8 /util
parent05cecaf49b96ae0c684a4d4fc90c157bad2f2b35 (diff)
downloadandroid_external_e2fsprogs-47b8941774df6bc134efd6d6051af33391fa3078.tar.gz
android_external_e2fsprogs-47b8941774df6bc134efd6d6051af33391fa3078.tar.bz2
android_external_e2fsprogs-47b8941774df6bc134efd6d6051af33391fa3078.zip
e2fsck: make sure system.data xattr is present
E2fsprogs used to assume that if i_size is less than 60 bytes, the system.data xattr isn't needed (and should be removed). The kernel disagree, and will declare the file system to be corrupted. Enforce the tighter constraints assumed by the kernel. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'util')
-rwxr-xr-x[-rw-r--r--]util/gen-sample-fs24
1 files changed, 17 insertions, 7 deletions
diff --git a/util/gen-sample-fs b/util/gen-sample-fs
index a6d7b31f..8e139160 100644..100755
--- a/util/gen-sample-fs
+++ b/util/gen-sample-fs
@@ -4,10 +4,10 @@ MNT=/mnt
FS=/tmp/foo.img
cp /dev/null $FS
-mke2fs -t ext4 -O inline_data -I 256 -b 4096 $FS 256
+mke2fs -q -t ext4 -O inline_data,^has_journal -I 256 -b 4096 -N 64 $FS 256
mount -t ext4 $FS $MNT
ln -s symlink_data $MNT/symlink
-for i in 30 70 500 1023 1024 1500; do
+for i in 30 70 500 1023 1024; do
ln -s /$(perl -e "print 'x' x $i;") $MNT/l_$i
done
touch $MNT/acl
@@ -18,13 +18,23 @@ setfacl -m g:daemon:r $MNT/acl
touch $MNT/simple_acl
setfacl -m u:daemon:r $MNT/simple_acl
touch $MNT/xattr
-attr -s foo -V bar $MNT/xattr
-echo -e "one\n\ttwo" | attr -s quux $MNT/xattr
-echo -e "abc\001\002\003" | attr -s def $MNT/xattr
+attr -q -s foo -V bar $MNT/xattr
+echo -e "one\n\ttwo" | attr -q -s quux $MNT/xattr
+echo -e "abc\001\002\003" | attr -q -s def $MNT/xattr
echo file_data > $MNT/small_inline
a="I am a very model of a modern major general;"
a="$a I've information vegetable, animal and mineral"
echo $a > $MNT/big_inline
+mkdir $MNT/sdir
+touch $MNT/sdir/1
+touch $MNT/sdir/2
+touch $MNT/sdir/3
+touch $MNT/sdir/4
+mkdir $MNT/mdir
+touch $MNT/mdir/1
+touch $MNT/mdir/2
+touch $MNT/mdir/3
+touch $MNT/mdir/4
+touch $MNT/mdir/5
umount $MNT
-
-
+e2fsck -fp $FS