<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext4, branch v3.4.41</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/ext4?h=v3.4.41</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/ext4?h=v3.4.41'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-05T17:04:37Z</updated>
<entry>
<title>ext4: use atomic64_t for the per-flexbg free_clusters count</title>
<updated>2013-04-05T17:04:37Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-03-12T03:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2457a4005a53bd8d9a266ab8f9f6388b57ca133a'/>
<id>urn:sha1:2457a4005a53bd8d9a266ab8f9f6388b57ca133a</id>
<content type='text'>
commit 90ba983f6889e65a3b506b30dc606aa9d1d46cd2 upstream.

A user who was using a 8TB+ file system and with a very large flexbg
size (&gt; 65536) could cause the atomic_t used in the struct flex_groups
to overflow.  This was detected by PaX security patchset:

http://forums.grsecurity.net/viewtopic.php?f=3&amp;t=3289&amp;p=12551#p12551

This bug was introduced in commit 9f24e4208f7e, so it's been around
since 2.6.30.  :-(

Fix this by using an atomic64_t for struct orlav_stats's
free_clusters.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: Lingzhu Xiang &lt;lxiang@redhat.com&gt;
Reviewed-by: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: convert number of blocks to clusters properly</title>
<updated>2013-04-05T17:04:36Z</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2013-03-02T22:18:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=46c14b9d861886d7abb66088ffeafa9301a34397'/>
<id>urn:sha1:46c14b9d861886d7abb66088ffeafa9301a34397</id>
<content type='text'>
commit 810da240f221d64bf90020f25941b05b378186fe upstream.

We're using macro EXT4_B2C() to convert number of blocks to number of
clusters for bigalloc file systems.  However, we should be using
EXT4_NUM_B2C().

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: Lingzhu Xiang &lt;lxiang@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: fix data=journal fast mount/umount hang</title>
<updated>2013-03-28T19:12:25Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-03-20T13:42:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2bb5c2c93a427a90c06b1c6b050642774912e7c8'/>
<id>urn:sha1:2bb5c2c93a427a90c06b1c6b050642774912e7c8</id>
<content type='text'>
commit 2b405bfa84063bfa35621d2d6879f52693c614b0 upstream.

In data=journal mode, if we unmount the file system before a
transaction has a chance to complete, when the journal inode is being
evicted, we can end up calling into jbd2_log_wait_commit() for the
last transaction, after the journalling machinery has been shut down.

Arguably we should adjust ext4_should_journal_data() to return FALSE
for the journal inode, but the only place it matters is
ext4_evict_inode(), and so to save a bit of CPU time, and to make the
patch much more obviously correct by inspection(tm), we'll fix it by
explicitly not trying to waiting for a journal commit when we are
evicting the journal inode, since it's guaranteed to never succeed in
this case.

This can be easily replicated via:

     mount -t ext4 -o data=journal /dev/vdb /vdb ; umount /vdb

------------[ cut here ]------------
WARNING: at /usr/projects/linux/ext4/fs/jbd2/journal.c:542 __jbd2_log_start_commit+0xba/0xcd()
Hardware name: Bochs
JBD2: bad log_start_commit: 3005630206 3005630206 0 0
Modules linked in:
Pid: 2909, comm: umount Not tainted 3.8.0-rc3 #1020
Call Trace:
 [&lt;c015c0ef&gt;] warn_slowpath_common+0x68/0x7d
 [&lt;c02b7e7d&gt;] ? __jbd2_log_start_commit+0xba/0xcd
 [&lt;c015c177&gt;] warn_slowpath_fmt+0x2b/0x2f
 [&lt;c02b7e7d&gt;] __jbd2_log_start_commit+0xba/0xcd
 [&lt;c02b8075&gt;] jbd2_log_start_commit+0x24/0x34
 [&lt;c0279ed5&gt;] ext4_evict_inode+0x71/0x2e3
 [&lt;c021f0ec&gt;] evict+0x94/0x135
 [&lt;c021f9aa&gt;] iput+0x10a/0x110
 [&lt;c02b7836&gt;] jbd2_journal_destroy+0x190/0x1ce
 [&lt;c0175284&gt;] ? bit_waitqueue+0x50/0x50
 [&lt;c028d23f&gt;] ext4_put_super+0x52/0x294
 [&lt;c020efe3&gt;] generic_shutdown_super+0x48/0xb4
 [&lt;c020f071&gt;] kill_block_super+0x22/0x60
 [&lt;c020f3e0&gt;] deactivate_locked_super+0x22/0x49
 [&lt;c020f5d6&gt;] deactivate_super+0x30/0x33
 [&lt;c0222795&gt;] mntput_no_expire+0x107/0x10c
 [&lt;c02233a7&gt;] sys_umount+0x2cf/0x2e0
 [&lt;c02233ca&gt;] sys_oldumount+0x12/0x14
 [&lt;c08096b8&gt;] syscall_call+0x7/0xb
---[ end trace 6a954cc790501c1f ]---
jbd2_log_wait_commit: error: j_commit_request=-1289337090, tid=0

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-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 the wrong number of the allocated blocks in ext4_split_extent()</title>
<updated>2013-03-28T19:12:18Z</updated>
<author>
<name>Zheng Liu</name>
<email>wenqing.lz@taobao.com</email>
</author>
<published>2013-03-11T01:20:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d24f1399d1a527ba8c08df5f5ac96b9bd3c0e1d1'/>
<id>urn:sha1:d24f1399d1a527ba8c08df5f5ac96b9bd3c0e1d1</id>
<content type='text'>
commit 3a2256702e47f68f921dfad41b1764d05c572329 upstream.

This commit fixes a wrong return value of the number of the allocated
blocks in ext4_split_extent.  When the length of blocks we want to
allocate is greater than the length of the current extent, we return a
wrong number.  Let's see what happens in the following case when we
call ext4_split_extent().

  map: [48, 72]
  ex:  [32, 64, u]

'ex' will be split into two parts:
  ex1: [32, 47, u]
  ex2: [48, 64, w]

'map-&gt;m_len' is returned from this function, and the value is 24.  But
the real length is 16.  So it should be fixed.

Meanwhile in this commit we use right length of the allocated blocks
when get_reserved_cluster_alloc in ext4_ext_handle_uninitialized_extents
is called.

Signed-off-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: fix free clusters calculation in bigalloc filesystem</title>
<updated>2013-03-03T22:06:42Z</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2013-02-22T20:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4234fb29a8c0a5c5eaee6de38fe3cba674daecd0'/>
<id>urn:sha1:4234fb29a8c0a5c5eaee6de38fe3cba674daecd0</id>
<content type='text'>
commit 304e220f0879198b1f5309ad6f0be862b4009491 upstream.

ext4_has_free_clusters() should tell us whether there is enough free
clusters to allocate, however number of free clusters in the file system
is converted to blocks using EXT4_C2B() which is not only wrong use of
the macro (we should have used EXT4_NUM_B2C) but it's also completely
wrong concept since everything else is in cluster units.

Moreover when calculating number of root clusters we should be using
macro EXT4_NUM_B2C() instead of EXT4_B2C() otherwise the result might be
off by one. However r_blocks_count should always be a multiple of the
cluster ratio so doing a plain bit shift should be enough here. We
avoid using EXT4_B2C() because it's confusing.

As a result of the first problem number of free clusters is much bigger
than it should have been and ext4_has_free_clusters() would return 1 even
if there is really not enough free clusters available.

Fix this by removing the EXT4_C2B() conversion of free clusters and
using bit shift when calculating number of root clusters. This bug
affects number of xfstests tests covering file system ENOSPC situation
handling. With this patch most of the ENOSPC problems with bigalloc file
system disappear, especially the errors caused by delayed allocation not
having enough space when the actual allocation is finally requested.

Signed-off-by: Lukas Czerner &lt;lczerner@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 xattr block allocation/release with bigalloc</title>
<updated>2013-03-03T22:06:42Z</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2013-02-18T17:12:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=19c9740ba7362357bde91267a0aa5109a809cd3e'/>
<id>urn:sha1:19c9740ba7362357bde91267a0aa5109a809cd3e</id>
<content type='text'>
commit 1231b3a1eb5740192aeebf5344dd6d6da000febf upstream.

Currently when new xattr block is created or released we we would call
dquot_free_block() or dquot_alloc_block() respectively, among the else
decrementing or incrementing the number of blocks assigned to the
inode by one block.

This however does not work for bigalloc file system because we always
allocate/free the whole cluster so we have to count with that in
dquot_free_block() and dquot_alloc_block() as well.

Use the clusters-to-blocks conversion EXT4_C2B() when passing number of
blocks to the dquot_alloc/free functions to fix the problem.

The problem has been revealed by xfstests #117 (and possibly others).

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: fix race in ext4_mb_add_n_trim()</title>
<updated>2013-03-03T22:06:42Z</updated>
<author>
<name>Niu Yawei</name>
<email>yawei.niu@gmail.com</email>
</author>
<published>2013-02-02T02:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=51e26006d1c9d5a2609d1bb6b7899cd86f92eed9'/>
<id>urn:sha1:51e26006d1c9d5a2609d1bb6b7899cd86f92eed9</id>
<content type='text'>
commit f1167009711032b0d747ec89a632a626c901a1ad upstream.

In ext4_mb_add_n_trim(), lg_prealloc_lock should be taken when
changing the lg_prealloc_list.

Signed-off-by: Niu Yawei &lt;yawei.niu@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: check bh in ext4_read_block_bitmap()</title>
<updated>2013-03-03T22:06:42Z</updated>
<author>
<name>Eryu Guan</name>
<email>guaneryu@gmail.com</email>
</author>
<published>2013-01-12T21:33:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ced2decfe31ba7b7b97cce2de010f75e8a90b412'/>
<id>urn:sha1:ced2decfe31ba7b7b97cce2de010f75e8a90b412</id>
<content type='text'>
commit 15b49132fc972c63894592f218ea5a9a61b1a18f upstream.

Validate the bh pointer before using it, since
ext4_read_block_bitmap_nowait() might return NULL.

I've seen this in fsfuzz testing.

 EXT4-fs error (device loop0): ext4_read_block_bitmap_nowait:385: comm touch: Cannot get buffer for block bitmap - block_group = 0, block_bitmap = 3925999616
 BUG: unable to handle kernel NULL pointer dereference at           (null)
 IP: [&lt;ffffffff8121de25&gt;] ext4_wait_block_bitmap+0x25/0xe0
 ...
 Call Trace:
  [&lt;ffffffff8121e1e5&gt;] ext4_read_block_bitmap+0x35/0x60
  [&lt;ffffffff8125e9c6&gt;] ext4_free_blocks+0x236/0xb80
  [&lt;ffffffff811d0d36&gt;] ? __getblk+0x36/0x70
  [&lt;ffffffff811d0a5f&gt;] ? __find_get_block+0x8f/0x210
  [&lt;ffffffff81191ef3&gt;] ? kmem_cache_free+0x33/0x140
  [&lt;ffffffff812678e5&gt;] ext4_xattr_release_block+0x1b5/0x1d0
  [&lt;ffffffff812679be&gt;] ext4_xattr_delete_inode+0xbe/0x100
  [&lt;ffffffff81222a7c&gt;] ext4_free_inode+0x7c/0x4d0
  [&lt;ffffffff812277b8&gt;] ? ext4_mark_inode_dirty+0x88/0x230
  [&lt;ffffffff8122993c&gt;] ext4_evict_inode+0x32c/0x490
  [&lt;ffffffff811b8cd7&gt;] evict+0xa7/0x1c0
  [&lt;ffffffff811b8ed3&gt;] iput_final+0xe3/0x170
  [&lt;ffffffff811b8f9e&gt;] iput+0x3e/0x50
  [&lt;ffffffff812316fd&gt;] ext4_add_nondir+0x4d/0x90
  [&lt;ffffffff81231d0b&gt;] ext4_create+0xeb/0x170
  [&lt;ffffffff811aae9c&gt;] vfs_create+0xac/0xd0
  [&lt;ffffffff811ac845&gt;] lookup_open+0x185/0x1c0
  [&lt;ffffffff8129e3b9&gt;] ? selinux_inode_permission+0xa9/0x170
  [&lt;ffffffff811acb54&gt;] do_last+0x2d4/0x7a0
  [&lt;ffffffff811af743&gt;] path_openat+0xb3/0x480
  [&lt;ffffffff8116a8a1&gt;] ? handle_mm_fault+0x251/0x3b0
  [&lt;ffffffff811afc49&gt;] do_filp_open+0x49/0xa0
  [&lt;ffffffff811bbaad&gt;] ? __alloc_fd+0xdd/0x150
  [&lt;ffffffff8119da28&gt;] do_sys_open+0x108/0x1f0
  [&lt;ffffffff8119db51&gt;] sys_open+0x21/0x30
  [&lt;ffffffff81618959&gt;] system_call_fastpath+0x16/0x1b

Also fix comment for ext4_read_block_bitmap_nowait()

Signed-off-by: Eryu Guan &lt;guaneryu@gmail.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: init pagevec in ext4_da_block_invalidatepages</title>
<updated>2013-01-21T19:45:24Z</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@redhat.com</email>
</author>
<published>2012-11-15T03:22:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5c9611090f9d110a245cc54ddb9bb31b2cc2965f'/>
<id>urn:sha1:5c9611090f9d110a245cc54ddb9bb31b2cc2965f</id>
<content type='text'>
commit 66bea92c69477a75a5d37b9bfed5773c92a3c4b4 upstream.

ext4_da_block_invalidatepages is missing a pagevec_init(),
which means that pvec-&gt;cold contains random garbage.

This affects whether the page goes to the front or
back of the LRU when -&gt;cold makes it to
free_hot_cold_page()

Reviewed-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Reviewed-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: lock i_mutex when truncating orphan inodes</title>
<updated>2013-01-17T16:50:53Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-12-27T06:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ed8e1a67302762d7a1e56e52ea00dc4a36c6cbf5'/>
<id>urn:sha1:ed8e1a67302762d7a1e56e52ea00dc4a36c6cbf5</id>
<content type='text'>
commit 721e3eba21e43532e438652dd8f1fcdfce3187e7 upstream.

Commit c278531d39 added a warning when ext4_flush_unwritten_io() is
called without i_mutex being taken.  It had previously not been taken
during orphan cleanup since races weren't possible at that point in
the mount process, but as a result of this c278531d39, we will now see
a kernel WARN_ON in this case.  Take the i_mutex in
ext4_orphan_cleanup() to suppress this warning.

Reported-by: Alexander Beregalov &lt;a.beregalov@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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