]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ext4: fix endianness breakage in ext4_split_extent_at()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 13 Apr 2012 00:32:25 +0000 (20:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Apr 2012 17:16:51 +0000 (10:16 -0700)
commit af1584f570b19b0285e4402a0b54731495d31784 upstream.

->ee_len is __le16, so assigning cpu_to_le32() to it is going to do
Bad Things(tm) on big-endian hosts...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Ted Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c

index 8a63efb4a7f1ce1984a7f24bbd631a5e2914752c..f920c189e5d17e64d2235a5782f36c1f0a6bd948 100644 (file)
@@ -2811,7 +2811,7 @@ static int ext4_split_extent_at(handle_t *handle,
                if (err)
                        goto fix_extent_len;
                /* update the extent length and mark as initialized */
-               ex->ee_len = cpu_to_le32(ee_len);
+               ex->ee_len = cpu_to_le16(ee_len);
                ext4_ext_try_to_merge(inode, path, ex);
                err = ext4_ext_dirty(handle, inode, path + depth);
                goto out;