<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext4, branch v3.4.11</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/ext4?h=v3.4.11</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/ext4?h=v3.4.11'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-08-26T22:00:42Z</updated>
<entry>
<title>ext4: fix kernel BUG on large-scale rm -rf commands</title>
<updated>2012-08-26T22:00:42Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-08-17T12:54:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d8b868fd75825114c23bc28d63ee2b87033df609'/>
<id>urn:sha1:d8b868fd75825114c23bc28d63ee2b87033df609</id>
<content type='text'>
commit 89a4e48f8479f8145eca9698f39fe188c982212f upstream.

Commit 968dee7722: "ext4: fix hole punch failure when depth is greater
than 0" introduced a regression in v3.5.1/v3.6-rc1 which caused kernel
crashes when users ran run "rm -rf" on large directory hierarchy on
ext4 filesystems on RAID devices:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000028

    Process rm (pid: 18229, threadinfo ffff8801276bc000, task ffff880123631710)
    Call Trace:
     [&lt;ffffffff81236483&gt;] ? __ext4_handle_dirty_metadata+0x83/0x110
     [&lt;ffffffff812353d3&gt;] ext4_ext_truncate+0x193/0x1d0
     [&lt;ffffffff8120a8cf&gt;] ? ext4_mark_inode_dirty+0x7f/0x1f0
     [&lt;ffffffff81207e05&gt;] ext4_truncate+0xf5/0x100
     [&lt;ffffffff8120cd51&gt;] ext4_evict_inode+0x461/0x490
     [&lt;ffffffff811a1312&gt;] evict+0xa2/0x1a0
     [&lt;ffffffff811a1513&gt;] iput+0x103/0x1f0
     [&lt;ffffffff81196d84&gt;] do_unlinkat+0x154/0x1c0
     [&lt;ffffffff8118cc3a&gt;] ? sys_newfstatat+0x2a/0x40
     [&lt;ffffffff81197b0b&gt;] sys_unlinkat+0x1b/0x50
     [&lt;ffffffff816135e9&gt;] system_call_fastpath+0x16/0x1b
    Code: 8b 4d 20 0f b7 41 02 48 8d 04 40 48 8d 04 81 49 89 45 18 0f b7 49 02 48 83 c1 01 49 89 4d 00 e9 ae f8 ff ff 0f 1f 00 49 8b 45 28 &lt;48&gt; 8b 40 28 49 89 45 20 e9 85 f8 ff ff 0f 1f 80 00 00 00

    RIP  [&lt;ffffffff81233164&gt;] ext4_ext_remove_space+0xa34/0xdf0

This could be reproduced as follows:

The problem in commit 968dee7722 was that caused the variable 'i' to
be left uninitialized if the truncate required more space than was
available in the journal.  This resulted in the function
ext4_ext_truncate_extend_restart() returning -EAGAIN, which caused
ext4_ext_remove_space() to restart the truncate operation after
starting a new jbd2 handle.

Reported-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Reported-by: Marti Raudsepp &lt;marti@juffo.org&gt;
Tested-by: Fengguang Wu &lt;fengguang.wu@intel.com&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 long mount times on very big file systems</title>
<updated>2012-08-26T22:00:42Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-08-16T15:59:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e1b5abaa966c9baaaf90c975c4ca377dd7ab4483'/>
<id>urn:sha1:e1b5abaa966c9baaaf90c975c4ca377dd7ab4483</id>
<content type='text'>
commit 0548bbb85337e532ca2ed697c3e9b227ff2ed4b4 upstream.

Commit 8aeb00ff85a: "ext4: fix overhead calculation used by
ext4_statfs()" introduced a O(n**2) calculation which makes very large
file systems take forever to mount.  Fix this with an optimization for
non-bigalloc file systems.  (For bigalloc file systems the overhead
needs to be set in the the superblock.)

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: avoid kmemcheck complaint from reading uninitialized memory</title>
<updated>2012-08-26T22:00:42Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-08-06T03:28:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9a321bec4fb122cb2bd60febfd9dc71eed7ee5b2'/>
<id>urn:sha1:9a321bec4fb122cb2bd60febfd9dc71eed7ee5b2</id>
<content type='text'>
commit 7e731bc9a12339f344cddf82166b82633d99dd86 upstream.

Commit 03179fe923 introduced a kmemcheck complaint in
ext4_da_get_block_prep() because we save and restore
ei-&gt;i_da_metadata_calc_last_lblock even though it is left
uninitialized in the case where i_da_metadata_calc_len is zero.

This doesn't hurt anything, but silencing the kmemcheck complaint
makes it easier for people to find real bugs.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45631
(which is marked as a regression).

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: make sure the journal sb is written in ext4_clear_journal_err()</title>
<updated>2012-08-26T22:00:42Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-08-05T23:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8b9f3861678e35b18cef66728d0fa896bbda65b6'/>
<id>urn:sha1:8b9f3861678e35b18cef66728d0fa896bbda65b6</id>
<content type='text'>
commit d796c52ef0b71a988364f6109aeb63d79c5b116b upstream.

After we transfer set the EXT4_ERROR_FS bit in the file system
superblock, it's not enough to call jbd2_journal_clear_err() to clear
the error indication from journal superblock --- we need to call
jbd2_journal_update_sb_errno() as well.  Otherwise, when the root file
system is mounted read-only, the journal is replayed, and the error
indicator is transferred to the superblock --- but the s_errno field
in the jbd2 superblock is left set (since although we cleared it in
memory, we never flushed it out to disk).

This can end up confusing e2fsck.  We should make e2fsck more robust
in this case, but the kernel shouldn't be leaving things in this
confused state, either.

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: undo ext4_calc_metadata_amount if we fail to claim space</title>
<updated>2012-08-09T15:31:41Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-07-23T04:00:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c0ce1fd51e122606d555dfd57f5c703b2af12146'/>
<id>urn:sha1:c0ce1fd51e122606d555dfd57f5c703b2af12146</id>
<content type='text'>
commit 03179fe92318e7934c180d96f12eff2cb36ef7b6 upstream.

The function ext4_calc_metadata_amount() has side effects, although
it's not obvious from its function name.  So if we fail to claim
space, regardless of whether we retry to claim the space again, or
return an error, we need to undo these side effects.

Otherwise we can end up incorrectly calculating the number of metadata
blocks needed for the operation, which was responsible for an xfstests
failure for test #271 when using an ext2 file system with delalloc
enabled.

Reported-by: Brian Foster &lt;bfoster@redhat.com&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: don't let i_reserved_meta_blocks go negative</title>
<updated>2012-08-09T15:31:41Z</updated>
<author>
<name>Brian Foster</name>
<email>bfoster@redhat.com</email>
</author>
<published>2012-07-23T03:59:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2dd71727e4bf6787caa56770b99a9102ac9a65f4'/>
<id>urn:sha1:2dd71727e4bf6787caa56770b99a9102ac9a65f4</id>
<content type='text'>
commit 97795d2a5b8d3c8dc4365d4bd3404191840453ba upstream.

If we hit a condition where we have allocated metadata blocks that
were not appropriately reserved, we risk underflow of
ei-&gt;i_reserved_meta_blocks.  In turn, this can throw
sbi-&gt;s_dirtyclusters_counter significantly out of whack and undermine
the nondelalloc fallback logic in ext4_nonda_switch().  Warn if this
occurs and set i_allocated_meta_blocks to avoid this problem.

This condition is reproduced by xfstests 270 against ext2 with
delalloc enabled:

Mar 28 08:58:02 localhost kernel: [  171.526344] EXT4-fs (loop1): delayed block allocation failed for inode 14 at logical offset 64486 with max blocks 64 with error -28
Mar 28 08:58:02 localhost kernel: [  171.526346] EXT4-fs (loop1): This should not happen!! Data will be lost

270 ultimately fails with an inconsistent filesystem and requires an
fsck to repair.  The cause of the error is an underflow in
ext4_da_update_reserve_space() due to an unreserved meta block
allocation.

Signed-off-by: Brian Foster &lt;bfoster@redhat.com&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 hole punch failure when depth is greater than 0</title>
<updated>2012-08-09T15:31:41Z</updated>
<author>
<name>Ashish Sangwan</name>
<email>ashishsangwan2@gmail.com</email>
</author>
<published>2012-07-23T02:49:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6918ff0bf4ba47ce863813fe5010796718219f8f'/>
<id>urn:sha1:6918ff0bf4ba47ce863813fe5010796718219f8f</id>
<content type='text'>
commit 968dee77220768a5f52cf8b21d0bdb73486febef upstream.

Whether to continue removing extents or not is decided by the return
value of function ext4_ext_more_to_rm() which checks 2 conditions:
a) if there are no more indexes to process.
b) if the number of entries are decreased in the header of "depth -1".

In case of hole punch, if the last block to be removed is not part of
the last extent index than this index will not be deleted, hence the
number of valid entries in the extent header of "depth - 1" will
remain as it is and ext4_ext_more_to_rm will return 0 although the
required blocks are not yet removed.

This patch fixes the above mentioned problem as instead of removing
the extents from the end of file, it starts removing the blocks from
the particular extent from which removing blocks is actually required
and continue backward until done.

Signed-off-by: Ashish Sangwan &lt;ashish.sangwan2@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@gmail.com&gt;
Reviewed-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: fix overhead calculation used by ext4_statfs()</title>
<updated>2012-08-09T15:31:41Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-07-09T20:27:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=25471391e7a0acace5821318fc0123a0a5cfdbbe'/>
<id>urn:sha1:25471391e7a0acace5821318fc0123a0a5cfdbbe</id>
<content type='text'>
commit 952fc18ef9ec707ebdc16c0786ec360295e5ff15 upstream.

Commit f975d6bcc7a introduced bug which caused ext4_statfs() to
miscalculate the number of file system overhead blocks.  This causes
the f_blocks field in the statfs structure to be larger than it should
be.  This would in turn cause the "df" output to show the number of
data blocks in the file system and the number of data blocks used to
be larger than they should be.

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: pass a char * to ext4_count_free() instead of a buffer_head ptr</title>
<updated>2012-08-09T15:31:40Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-06-30T23:14:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a271d6a66d1d10f001c5653da68c1f72d0ded59'/>
<id>urn:sha1:2a271d6a66d1d10f001c5653da68c1f72d0ded59</id>
<content type='text'>
commit f6fb99cadcd44660c68e13f6eab28333653621e6 upstream.

Make it possible for ext4_count_free to operate on buffers and not
just data in buffer_heads.

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 duplicated mnt_drop_write call in EXT4_IOC_MOVE_EXT</title>
<updated>2012-07-29T15:04:19Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2012-07-18T08:31:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2dbbb550c56cbaf9d8353f4546aab9a88786d279'/>
<id>urn:sha1:2dbbb550c56cbaf9d8353f4546aab9a88786d279</id>
<content type='text'>
commit 331ae4962b975246944ea039697a8f1cadce42bb upstream.

Caused, AFAICS, by mismerge in commit ff9cb1c4eead ("Merge branch
'for_linus' into for_linus_merged")

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
