<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext4, branch v3.13</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/ext4?h=v3.13</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/ext4?h=v3.13'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-01-06T19:00:23Z</updated>
<entry>
<title>ext4: fix bigalloc regression</title>
<updated>2014-01-06T19:00:23Z</updated>
<author>
<name>Eric Whitney</name>
<email>enwlinux@gmail.com</email>
</author>
<published>2014-01-06T19:00:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d0abafac8c9162f39c4f6b2f8141b772a09b3770'/>
<id>urn:sha1:d0abafac8c9162f39c4f6b2f8141b772a09b3770</id>
<content type='text'>
Commit f5a44db5d2 introduced a regression on filesystems created with
the bigalloc feature (cluster size &gt; blocksize).  It causes xfstests
generic/006 and /013 to fail with an unexpected JBD2 failure and
transaction abort that leaves the test file system in a read only state.
Other xfstests run on bigalloc file systems are likely to fail as well.

The cause is the accidental use of a cluster mask where a cluster
offset was needed in ext4_ext_map_blocks().

Signed-off-by: Eric Whitney &lt;enwlinux@gmail.com&gt;
</content>
</entry>
<entry>
<title>ext4: add explicit casts when masking cluster sizes</title>
<updated>2013-12-20T14:29:35Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-12-20T14:29:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f5a44db5d2d677dfbf12deee461f85e9ec633961'/>
<id>urn:sha1:f5a44db5d2d677dfbf12deee461f85e9ec633961</id>
<content type='text'>
The missing casts can cause the high 64-bits of the physical blocks to
be lost.  Set up new macros which allows us to make sure the right
thing happen, even if at some point we end up supporting larger
logical block numbers.

Thanks to the Emese Revfy and the PaX security team for reporting this
issue.

Reported-by: PaX Team &lt;pageexec@freemail.hu&gt;
Reported-by: Emese Revfy &lt;re.emese@gmail.com&gt;                                 
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: fix deadlock when writing in ENOSPC conditions</title>
<updated>2013-12-18T05:44:44Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2013-12-18T05:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=34cf865d54813aab3497838132fb1bbd293f4054'/>
<id>urn:sha1:34cf865d54813aab3497838132fb1bbd293f4054</id>
<content type='text'>
Akira-san has been reporting rare deadlocks of his machine when running
xfstests test 269 on ext4 filesystem. The problem turned out to be in
ext4_da_reserve_metadata() and ext4_da_reserve_space() which called
ext4_should_retry_alloc() while holding i_data_sem. Since
ext4_should_retry_alloc() can force a transaction commit, this is a
lock ordering violation and leads to deadlocks.

Fix the problem by just removing the retry loops. These functions should
just report ENOSPC to the caller (e.g. ext4_da_write_begin()) and that
function must take care of retrying after dropping all necessary locks.

Reported-and-tested-by: Akira Fujita &lt;a-fujita@rs.jp.nec.com&gt;
Reviewed-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: Do not reserve clusters when fs doesn't support extents</title>
<updated>2013-12-09T02:11:59Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2013-12-09T02:11:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=30fac0f75da24dd5bb43c9e911d2039a984ac815'/>
<id>urn:sha1:30fac0f75da24dd5bb43c9e911d2039a984ac815</id>
<content type='text'>
When the filesystem doesn't support extents (like in ext2/3
compatibility modes), there is no need to reserve any clusters. Space
estimates for writing are exact, hole punching doesn't need new
metadata, and there are no unwritten extents to convert.

This fixes a problem when filesystem still having some free space when
accessed with a native ext2/3 driver suddently reports ENOSPC when
accessed with ext4 driver.

Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Tested-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Reviewed-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: fix del_timer() misuse for -&gt;s_err_report</title>
<updated>2013-12-09T01:52:31Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2013-12-09T01:52:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9105bb149bbbc555d2e11ba5166dfe7a24eae09e'/>
<id>urn:sha1:9105bb149bbbc555d2e11ba5166dfe7a24eae09e</id>
<content type='text'>
That thing should be del_timer_sync(); consider what happens
if ext4_put_super() call of del_timer() happens to come just as it's
getting run on another CPU.  Since that timer reschedules itself
to run next day, you are pretty much guaranteed that you'll end up
with kfree'd scheduled timer, with usual fun consequences.  AFAICS,
that's -stable fodder all way back to 2010... [the second del_timer_sync()
is almost certainly not needed, but it doesn't hurt either]

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: check for overlapping extents in ext4_valid_extent_entries()</title>
<updated>2013-12-04T02:22:21Z</updated>
<author>
<name>Eryu Guan</name>
<email>guaneryu@gmail.com</email>
</author>
<published>2013-12-04T02:22:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5946d089379a35dda0e531710b48fca05446a196'/>
<id>urn:sha1:5946d089379a35dda0e531710b48fca05446a196</id>
<content type='text'>
A corrupted ext4 may have out of order leaf extents, i.e.

extent: lblk 0--1023, len 1024, pblk 9217, flags: LEAF UNINIT
extent: lblk 1000--2047, len 1024, pblk 10241, flags: LEAF UNINIT
             ^^^^ overlap with previous extent

Reading such extent could hit BUG_ON() in ext4_es_cache_extent().

	BUG_ON(end &lt; lblk);

The problem is that __read_extent_tree_block() tries to cache holes as
well but assumes 'lblk' is greater than 'prev' and passes underflowed
length to ext4_es_cache_extent(). Fix it by checking for overlapping
extents in ext4_valid_extent_entries().

I hit this when fuzz testing ext4, and am able to reproduce it by
modifying the on-disk extent by hand.

Also add the check for (ee_block + len - 1) in ext4_valid_extent() to
make sure the value is not overflow.

Ran xfstests on patched ext4 and no regression.

Cc: Lukáš Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: Eryu Guan &lt;guaneryu@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: fix use-after-free in ext4_mb_new_blocks</title>
<updated>2013-12-03T23:10:28Z</updated>
<author>
<name>Junho Ryu</name>
<email>jayr@google.com</email>
</author>
<published>2013-12-03T23:10:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4e8d2139802ce4f41936a687f06c560b12115247'/>
<id>urn:sha1:4e8d2139802ce4f41936a687f06c560b12115247</id>
<content type='text'>
ext4_mb_put_pa should hold pa-&gt;pa_lock before accessing pa-&gt;pa_count.
While ext4_mb_use_preallocated checks pa-&gt;pa_deleted first and then
increments pa-&gt;count later, ext4_mb_put_pa decrements pa-&gt;pa_count
before holding pa-&gt;pa_lock and then sets pa-&gt;pa_deleted.

* Free sequence
ext4_mb_put_pa (1):		atomic_dec_and_test pa-&gt;pa_count
ext4_mb_put_pa (2):		lock pa-&gt;pa_lock
ext4_mb_put_pa (3):			check pa-&gt;pa_deleted
ext4_mb_put_pa (4):			set pa-&gt;pa_deleted=1
ext4_mb_put_pa (5):		unlock pa-&gt;pa_lock
ext4_mb_put_pa (6):		remove pa from a list
ext4_mb_pa_callback:		free pa

* Use sequence
ext4_mb_use_preallocated (1):	iterate over preallocation
ext4_mb_use_preallocated (2):	lock pa-&gt;pa_lock
ext4_mb_use_preallocated (3):		check pa-&gt;pa_deleted
ext4_mb_use_preallocated (4):		increase pa-&gt;pa_count
ext4_mb_use_preallocated (5):	unlock pa-&gt;pa_lock
ext4_mb_release_context:	access pa

* Use-after-free sequence
[initial status]		&lt;pa-&gt;pa_deleted = 0, pa_count = 1&gt;
ext4_mb_use_preallocated (1):	iterate over preallocation
ext4_mb_use_preallocated (2):	lock pa-&gt;pa_lock
ext4_mb_use_preallocated (3):		check pa-&gt;pa_deleted
ext4_mb_put_pa (1):		atomic_dec_and_test pa-&gt;pa_count
[pa_count decremented]		&lt;pa-&gt;pa_deleted = 0, pa_count = 0&gt;
ext4_mb_use_preallocated (4):		increase pa-&gt;pa_count
[pa_count incremented]		&lt;pa-&gt;pa_deleted = 0, pa_count = 1&gt;
ext4_mb_use_preallocated (5):	unlock pa-&gt;pa_lock
ext4_mb_put_pa (2):		lock pa-&gt;pa_lock
ext4_mb_put_pa (3):			check pa-&gt;pa_deleted
ext4_mb_put_pa (4):			set pa-&gt;pa_deleted=1
[race condition!]		&lt;pa-&gt;pa_deleted = 1, pa_count = 1&gt;
ext4_mb_put_pa (5):		unlock pa-&gt;pa_lock
ext4_mb_put_pa (6):		remove pa from a list
ext4_mb_pa_callback:		free pa
ext4_mb_release_context:	access pa

AddressSanitizer has detected use-after-free in ext4_mb_new_blocks
Bug report: http://goo.gl/rG1On3

Signed-off-by: Junho Ryu &lt;jayr@google.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails</title>
<updated>2013-12-02T14:31:36Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-12-02T14:31:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ae1495b12df1897d4f42842a7aa7276d920f6290'/>
<id>urn:sha1:ae1495b12df1897d4f42842a7aa7276d920f6290</id>
<content type='text'>
While it's true that errors can only happen if there is a bug in
jbd2_journal_dirty_metadata(), if a bug does happen, we need to halt
the kernel or remount the file system read-only in order to avoid
further data loss.  The ext4_journal_abort_handle() function doesn't
do any of this, and while it's likely that this call (since it doesn't
adjust refcounts) will likely result in the file system eventually
deadlocking since the current transaction will never be able to close,
it's much cleaner to call let ext4's error handling system deal with
this situation.

There's a separate bug here which is that if certain jbd2 errors
errors occur and file system is mounted errors=continue, the file
system will probably eventually end grind to a halt as described
above.  But things have been this way in a long time, and usually when
we have these sorts of errors it's pretty much a disaster --- and
that's why the jbd2 layer aggressively retries memory allocations,
which is the most likely cause of these jbd2 errors.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4</title>
<updated>2013-11-14T08:19:58Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-11-14T08:19:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4fbf888accb39af423f271111d44e8186f053723'/>
<id>urn:sha1:4fbf888accb39af423f271111d44e8186f053723</id>
<content type='text'>
Pull ext4 changes from Ted Ts'o:
 "Ext4 updates for 3.13.  Mostly bug fixes and cleanups"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: add prototypes for macro-generated functions
  ext4: return non-zero st_blocks for inline data
  ext4: use prandom_u32() instead of get_random_bytes()
  ext4: remove unreachable code after ext4_can_extents_be_merged()
  ext4: remove unreachable code in ext4_can_extents_be_merged()
  ext4: avoid bh leak in retry path of ext4_expand_extra_isize_ea()
  ext4: don't count free clusters from a corrupt block group
  ext4: fix FITRIM in no journal mode
  ext4: drop set but otherwise unused variable from ext4_add_dirent_to_inline()
  ext4: change ext4_read_inline_dir() to return 0 on success
  ext4: pair trace_ext4_writepages &amp; trace_ext4_writepages_result
  ext4: add ratelimiting to ext4 messages
  ext4: fix performance regression in ext4_writepages
  ext4: fixup kerndoc annotation of mpage_map_and_submit_extent()
  ext4: fix assertion in ext4_add_complete_io()
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2013-11-13T06:34:18Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-11-13T06:34:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9bc9ccd7db1c9f043f75380b5a5b94912046a60e'/>
<id>urn:sha1:9bc9ccd7db1c9f043f75380b5a5b94912046a60e</id>
<content type='text'>
Pull vfs updates from Al Viro:
 "All kinds of stuff this time around; some more notable parts:

   - RCU'd vfsmounts handling
   - new primitives for coredump handling
   - files_lock is gone
   - Bruce's delegations handling series
   - exportfs fixes

  plus misc stuff all over the place"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (101 commits)
  ecryptfs: -&gt;f_op is never NULL
  locks: break delegations on any attribute modification
  locks: break delegations on link
  locks: break delegations on rename
  locks: helper functions for delegation breaking
  locks: break delegations on unlink
  namei: minor vfs_unlink cleanup
  locks: implement delegations
  locks: introduce new FL_DELEG lock flag
  vfs: take i_mutex on renamed file
  vfs: rename I_MUTEX_QUOTA now that it's not used for quotas
  vfs: don't use PARENT/CHILD lock classes for non-directories
  vfs: pull ext4's double-i_mutex-locking into common code
  exportfs: fix quadratic behavior in filehandle lookup
  exportfs: better variable name
  exportfs: move most of reconnect_path to helper function
  exportfs: eliminate unused "noprogress" counter
  exportfs: stop retrying once we race with rename/remove
  exportfs: clear DISCONNECTED on all parents sooner
  exportfs: more detailed comment for path_reconnect
  ...
</content>
</entry>
</feed>
