summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-fs/e2fsprogs/files/e2fsprogs-1.34-swap-symlink.diff')
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.34-swap-symlink.diff28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.34-swap-symlink.diff b/sys-fs/e2fsprogs/files/e2fsprogs-1.34-swap-symlink.diff
new file mode 100644
index 000000000000..27d5956f3786
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.34-swap-symlink.diff
@@ -0,0 +1,28 @@
+ext2fs_swap_inode assumes that symlinks with i_blocks > 0 are slow. If a
+fast symlink has extended attributes, these are accounted for in
+i_blocks too, so on big endian machines, ext2fs_swap_inode swaps the
+i_block array of fast symlinks.
+
+ Andreas Gruenbacher <agruen@suse.de>, SuSE Labs
+
+--- e2fsprogs-1.34/lib/ext2fs/swapfs.c.orig 2003-08-30 11:33:42.000000000 +0000
++++ e2fsprogs-1.34/lib/ext2fs/swapfs.c 2003-08-30 11:47:57.000000000 +0000
+@@ -75,7 +75,7 @@
+ void ext2fs_swap_inode(ext2_filsys fs, struct ext2_inode *t,
+ struct ext2_inode *f, int hostorder)
+ {
+- unsigned i;
++ unsigned i, xattr_blocks;
+ int islnk = 0;
+
+ if (hostorder && LINUX_S_ISLNK(f->i_mode))
+@@ -93,7 +93,8 @@
+ t->i_links_count = ext2fs_swab16(f->i_links_count);
+ t->i_blocks = ext2fs_swab32(f->i_blocks);
+ t->i_flags = ext2fs_swab32(f->i_flags);
+- if (!islnk || f->i_blocks) {
++ xattr_blocks = (t->i_file_acl) ? (fs->blocksize >> 9) : 0;
++ if (!islnk || t->i_blocks - xattr_blocks) {
+ for (i = 0; i < EXT2_N_BLOCKS; i++)
+ t->i_block[i] = ext2fs_swab32(f->i_block[i]);
+ } else if (t != f) {