<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/ext4/xattr.c, branch linux-4.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-09-15T06:20:26Z</updated>
<entry>
<title>ext4: avoid modifying checksum fields directly during checksum verification</title>
<updated>2016-09-15T06:20:26Z</updated>
<author>
<name>Daeho Jeong</name>
</author>
<published>2016-07-03T21:51:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c9274d891869880648c4ee9365df3ecc7ba2e285'/>
<id>urn:sha1:c9274d891869880648c4ee9365df3ecc7ba2e285</id>
<content type='text'>
commit b47820edd1634dc1208f9212b7ecfb4230610a23 upstream.

We temporally change checksum fields in buffers of some types of
metadata into '0' for verifying the checksum values. By doing this
without locking the buffer, some metadata's checksums, which are
being committed or written back to the storage, could be damaged.
In our test, several metadata blocks were found with damaged metadata
checksum value during recovery process. When we only verify the
checksum value, we have to avoid modifying checksum fields directly.

Signed-off-by: Daeho Jeong &lt;daeho.jeong@samsung.com&gt;
Signed-off-by: Youngjin Gil &lt;youngjin.gil@samsung.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reviewed-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Cc: Török Edwin &lt;edwin@etorok.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: avoid deadlock when expanding inode size</title>
<updated>2016-09-15T06:20:26Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-08-11T16:38:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5f4100b7447787b1d86476ef5743f9d690390c3f'/>
<id>urn:sha1:5f4100b7447787b1d86476ef5743f9d690390c3f</id>
<content type='text'>
commit 2e81a4eeedcaa66e35f58b81e0755b87057ce392 upstream.

When we need to move xattrs into external xattr block, we call
ext4_xattr_block_set() from ext4_expand_extra_isize_ea(). That may end
up calling ext4_mark_inode_dirty() again which will recurse back into
the inode expansion code leading to deadlocks.

Protect from recursion using EXT4_STATE_NO_EXPAND inode flag and move
its management into ext4_expand_extra_isize_ea() since its manipulation
is safe there (due to xattr_sem) from possible races with
ext4_xattr_set_handle() which plays with it as well.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: properly align shifted xattrs when expanding inodes</title>
<updated>2016-09-15T06:20:26Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-08-11T16:00:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4039c808f2643f403fa21d62ed530ca6c2aafae'/>
<id>urn:sha1:d4039c808f2643f403fa21d62ed530ca6c2aafae</id>
<content type='text'>
commit 443a8c41cd49de66a3fda45b32b9860ea0292b84 upstream.

We did not count with the padding of xattr value when computing desired
shift of xattrs in the inode when expanding i_extra_isize. As a result
we could create unaligned start of inline xattrs. Account for alignment
properly.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: fix xattr shifting when expanding inodes part 2</title>
<updated>2016-09-15T06:20:26Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-08-11T15:58:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee0775439b230d331fd419c24234dc33978a3418'/>
<id>urn:sha1:ee0775439b230d331fd419c24234dc33978a3418</id>
<content type='text'>
commit 418c12d08dc64a45107c467ec1ba29b5e69b0715 upstream.

When multiple xattrs need to be moved out of inode, we did not properly
recompute total size of xattr headers in the inode and the new header
position. Thus when moving the second and further xattr we asked
ext4_xattr_shift_entries() to move too much and from the wrong place,
resulting in possible xattr value corruption or general memory
corruption.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: fix xattr shifting when expanding inodes</title>
<updated>2016-09-15T06:20:26Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-08-11T15:50:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e792c6d66216535eab1a123607c22ff7d1e046c'/>
<id>urn:sha1:0e792c6d66216535eab1a123607c22ff7d1e046c</id>
<content type='text'>
commit d0141191a20289f8955c1e03dad08e42e6f71ca9 upstream.

The code in ext4_expand_extra_isize_ea() treated new_extra_isize
argument sometimes as the desired target i_extra_isize and sometimes as
the amount by which we need to grow current i_extra_isize. These happen
to coincide when i_extra_isize is 0 which used to be the common case and
so nobody noticed this until recently when we added i_projid to the
inode and so i_extra_isize now needs to grow from 28 to 32 bytes.

The result of these bugs was that we sometimes unnecessarily decided to
move xattrs out of inode even if there was enough space and we often
ended up corrupting in-inode xattrs because arguments to
ext4_xattr_shift_entries() were just wrong. This could demonstrate
itself as BUG_ON in ext4_xattr_shift_entries() triggering.

Fix the problem by introducing new isize_diff variable and use it where
appropriate.

Reported-by: Dave Chinner &lt;david@fromorbit.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: check if in-inode xattr is corrupted in ext4_expand_extra_isize_ea()</title>
<updated>2016-03-22T20:13:15Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2016-03-22T20:13:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9e92f48c34eb2b9af9d12f892e2fe1fce5e8ce35'/>
<id>urn:sha1:9e92f48c34eb2b9af9d12f892e2fe1fce5e8ce35</id>
<content type='text'>
We aren't checking to see if the in-inode extended attribute is
corrupted before we try to expand the inode's extra isize fields.

This can lead to potential crashes caused by the BUG_ON() check in
ext4_xattr_shift_entries().

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>mbcache: add reusable flag to cache entries</title>
<updated>2016-02-23T03:44:04Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2016-02-23T03:44:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6048c64b26097a0ffbd966866b599f990e674e9b'/>
<id>urn:sha1:6048c64b26097a0ffbd966866b599f990e674e9b</id>
<content type='text'>
To reduce amount of damage caused by single bad block, we limit number
of inodes sharing an xattr block to 1024. Thus there can be more xattr
blocks with the same contents when there are lots of files with the same
extended attributes. These xattr blocks naturally result in hash
collisions and can form long hash chains and we unnecessarily check each
such block only to find out we cannot use it because it is already
shared by too many inodes.

Add a reusable flag to cache entries which is cleared when a cache entry
has reached its maximum refcount.  Cache entries which are not marked
reusable are skipped by mb_cache_entry_find_{first,next}. This
significantly speeds up mbcache when there are many same xattr blocks.
For example for xattr-bench with 5 values and each process handling
20000 files, the run for 64 processes is 25x faster with this patch.
Even for 8 processes the speedup is almost 3x. We have also verified
that for situations where there is only one xattr block of each kind,
the patch doesn't have a measurable cost.

[JK: Remove handling of setting the same value since it is not needed
anymore, check for races in e_reusable setting, improve changelog,
add measurements]

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: shortcut setting of xattr to the same value</title>
<updated>2016-02-23T03:43:04Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-02-23T03:43:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3fd164629d25b04f291a79a013dcc7ce1a301269'/>
<id>urn:sha1:3fd164629d25b04f291a79a013dcc7ce1a301269</id>
<content type='text'>
When someone tried to set xattr to the same value (i.e., not changing
anything) we did all the work of removing original xattr, possibly
breaking references to shared xattr block, inserting new xattr, and
merging xattr blocks again. Since this is not so rare operation and it
is relatively cheap for us to detect this case, check for this and
shortcut xattr setting in that case.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>mbcache2: rename to mbcache</title>
<updated>2016-02-23T03:35:22Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-02-23T03:35:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a2508e1b657cfc7e1371550f88c7a7bc4288f32'/>
<id>urn:sha1:7a2508e1b657cfc7e1371550f88c7a7bc4288f32</id>
<content type='text'>
Since old mbcache code is gone, let's rename new code to mbcache since
number 2 is now meaningless. This is just a mechanical replacement.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: convert to mbcache2</title>
<updated>2016-02-22T16:50:13Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-02-22T16:50:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=82939d7999dfc1f1998c4b1c12e2f19edbdff272'/>
<id>urn:sha1:82939d7999dfc1f1998c4b1c12e2f19edbdff272</id>
<content type='text'>
The conversion is generally straightforward. The only tricky part is
that xattr block corresponding to found mbcache entry can get freed
before we get buffer lock for that block. So we have to check whether
the entry is still valid after getting buffer lock.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
