<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext4, branch v3.9</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/ext4?h=v3.9</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/ext4?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-03T16:37:17Z</updated>
<entry>
<title>ext4: fix big-endian bugs which could cause fs corruptions</title>
<updated>2013-04-03T16:37:17Z</updated>
<author>
<name>Zheng Liu</name>
<email>wenqing.lz@taobao.com</email>
</author>
<published>2013-04-03T16:27:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8cde7ad17e4f4ff8d12ff60dd09c0a291cb0b61c'/>
<id>urn:sha1:8cde7ad17e4f4ff8d12ff60dd09c0a291cb0b61c</id>
<content type='text'>
When an extent was zeroed out, we forgot to do convert from cpu to le16.
It could make us hit a BUG_ON when we try to write dirty pages out.  So
fix it.

[ Also fix a bug found by Dmitry Monakhov where we were missing
  le32_to_cpu() calls in the new indirect punch hole code.

  There are a number of other big endian warnings found by static code
  analyzers, but we'll wait for the next merge window to fix them all
  up.  These fixes are designed to be Obviously Correct by code
  inspection, and easy to demonstrate that it won't make any
  difference (and hence, won't introduce any bugs) on little endian
  architectures such as x86.  --tytso ]

Signed-off-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reported-by: CAI Qian &lt;caiqian@redhat.com&gt;
Reported-by: Christian Kujau &lt;lists@nerdbynature.de&gt;
Cc: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'ext4_for_linue' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4</title>
<updated>2013-03-22T00:56:10Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-03-22T00:56:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d3c926264a92e5ea448add3e883530e1edad3ce2'/>
<id>urn:sha1:d3c926264a92e5ea448add3e883530e1edad3ce2</id>
<content type='text'>
Pull ext4 fixes from Ted Ts'o:
 "Fix a number of regression and other bugs in ext4, most of which were
  relatively obscure cornercases or races that were found using
  regression tests."

* tag 'ext4_for_linue' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (21 commits)
  ext4: fix data=journal fast mount/umount hang
  ext4: fix ext4_evict_inode() racing against workqueue processing code
  ext4: fix memory leakage in mext_check_coverage
  ext4: use s_extent_max_zeroout_kb value as number of kb
  ext4: use atomic64_t for the per-flexbg free_clusters count
  jbd2: fix use after free in jbd2_journal_dirty_metadata()
  ext4: reserve metadata block for every delayed write
  ext4: update reserved space after the 'correction'
  ext4: do not use yield()
  ext4: remove unused variable in ext4_free_blocks()
  ext4: fix WARN_ON from ext4_releasepage()
  ext4: fix the wrong number of the allocated blocks in ext4_split_extent()
  ext4: update extent status tree after an extent is zeroed out
  ext4: fix wrong m_len value after unwritten extent conversion
  ext4: add self-testing infrastructure to do a sanity check
  ext4: avoid a potential overflow in ext4_es_can_be_merged()
  ext4: invalidate extent status tree during extent migration
  ext4: remove unnecessary wait for extent conversion in ext4_fallocate()
  ext4: add warning to ext4_convert_unwritten_extents_endio
  ext4: disable merging of uninitialized extents
  ...
</content>
</entry>
<entry>
<title>ext4: fix data=journal fast mount/umount hang</title>
<updated>2013-03-20T13:42:11Z</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=2b405bfa84063bfa35621d2d6879f52693c614b0'/>
<id>urn:sha1:2b405bfa84063bfa35621d2d6879f52693c614b0</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org

</content>
</entry>
<entry>
<title>ext4: fix ext4_evict_inode() racing against workqueue processing code</title>
<updated>2013-03-20T13:39:42Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-03-20T13:39:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1ada47d9468fe3907f7f9e00179168f5e2f90803'/>
<id>urn:sha1:1ada47d9468fe3907f7f9e00179168f5e2f90803</id>
<content type='text'>
Commit 84c17543ab56 (ext4: move work from io_end to inode) triggered a
regression when running xfstest #270 when the file system is mounted
with dioread_nolock.

The problem is that after ext4_evict_inode() calls ext4_ioend_wait(),
this guarantees that last io_end structure has been freed, but it does
not guarantee that the workqueue structure, which was moved into the
inode by commit 84c17543ab56, is actually finished.  Once
ext4_flush_completed_IO() calls ext4_free_io_end() on CPU #1, this
will allow ext4_ioend_wait() to return on CPU #2, at which point the
evict_inode() codepath can race against the workqueue code on CPU #1
accessing EXT4_I(inode)-&gt;i_unwritten_work to find the next item of
work to do.

Fix this by calling cancel_work_sync() in ext4_ioend_wait(), which
will be renamed ext4_ioend_shutdown(), since it is only used by
ext4_evict_inode().  Also, move the call to ext4_ioend_shutdown()
until after truncate_inode_pages() and filemap_write_and_wait() are
called, to make sure all dirty pages have been written back and
flushed from the page cache first.

BUG: unable to handle kernel NULL pointer dereference at   (null)
IP: [&lt;c01dda6a&gt;] cwq_activate_delayed_work+0x3b/0x7e
*pdpt = 0000000030bc3001 *pde = 0000000000000000 
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
Modules linked in:
Pid: 6, comm: kworker/u:0 Not tainted 3.8.0-rc3-00013-g84c1754-dirty #91 Bochs Bochs
EIP: 0060:[&lt;c01dda6a&gt;] EFLAGS: 00010046 CPU: 0
EIP is at cwq_activate_delayed_work+0x3b/0x7e
EAX: 00000000 EBX: 00000000 ECX: f505fe54 EDX: 00000000
ESI: ed5b697c EDI: 00000006 EBP: f64b7e8c ESP: f64b7e84
 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
CR0: 8005003b CR2: 00000000 CR3: 30bc2000 CR4: 000006f0
DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
DR6: ffff0ff0 DR7: 00000400
Process kworker/u:0 (pid: 6, ti=f64b6000 task=f64b4160 task.ti=f64b6000)
Stack:
 f505fe00 00000006 f64b7e9c c01de3d7 f6435540 00000003 f64b7efc c01def1d
 f6435540 00000002 00000000 0000008a c16d0808 c040a10b c16d07d8 c16d08b0
 f505fe00 c16d0780 00000000 00000000 ee153df4 c1ce4a30 c17d0e30 00000000
Call Trace:
 [&lt;c01de3d7&gt;] cwq_dec_nr_in_flight+0x71/0xfb
 [&lt;c01def1d&gt;] process_one_work+0x5d8/0x637
 [&lt;c040a10b&gt;] ? ext4_end_bio+0x300/0x300
 [&lt;c01e3105&gt;] worker_thread+0x249/0x3ef
 [&lt;c01ea317&gt;] kthread+0xd8/0xeb
 [&lt;c01e2ebc&gt;] ? manage_workers+0x4bb/0x4bb
 [&lt;c023a370&gt;] ? trace_hardirqs_on+0x27/0x37
 [&lt;c0f1b4b7&gt;] ret_from_kernel_thread+0x1b/0x28
 [&lt;c01ea23f&gt;] ? __init_kthread_worker+0x71/0x71
Code: 01 83 15 ac ff 6c c1 00 31 db 89 c6 8b 00 a8 04 74 12 89 c3 30 db 83 05 b0 ff 6c c1 01 83 15 b4 ff 6c c1 00 89 f0 e8 42 ff ff ff &lt;8b&gt; 13 89 f0 83 05 b8 ff 6c c1
 6c c1 00 31 c9 83
EIP: [&lt;c01dda6a&gt;] cwq_activate_delayed_work+0x3b/0x7e SS:ESP 0068:f64b7e84
CR2: 0000000000000000
---[ end trace a1923229da53d8a4 ]---

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>ext4: fix memory leakage in mext_check_coverage</title>
<updated>2013-03-18T15:40:19Z</updated>
<author>
<name>Dmitry Monakhov</name>
<email>dmonakhov@openvz.org</email>
</author>
<published>2013-03-18T15:40:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0e401101db49959f5783f6ee9e676124b5a183ac'/>
<id>urn:sha1:0e401101db49959f5783f6ee9e676124b5a183ac</id>
<content type='text'>
Regression was introduced by following commit 8c854473
TESTCASE (git://oss.sgi.com/xfs/cmds/xfstests.git):
#while true;do ./check 301 || break ;done

Also fix potential memory leakage in get_ext_path() once
ext4_ext_find_extent() have failed.

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>fs: Readd the fs module aliases.</title>
<updated>2013-03-13T01:55:21Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2013-03-13T01:27:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fa7614ddd6c2368b8cd54cc67ab4b767af0a2a50'/>
<id>urn:sha1:fa7614ddd6c2368b8cd54cc67ab4b767af0a2a50</id>
<content type='text'>
I had assumed that the only use of module aliases for filesystems
prior to "fs: Limit sys_mount to only request filesystem modules."
was in request_module.  It turns out I was wrong.  At least mkinitcpio
in Arch linux uses these aliases.

So readd the preexising aliases, to keep from breaking userspace.

Userspace eventually will have to follow and use the same aliases the
kernel does.  So at some point we may be delete these aliases without
problems.  However that day is not today.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>ext4: use s_extent_max_zeroout_kb value as number of kb</title>
<updated>2013-03-12T16:40:04Z</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2013-03-12T16:40:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4f42f80a8f08d4c3f52c4267361241885d5dee3a'/>
<id>urn:sha1:4f42f80a8f08d4c3f52c4267361241885d5dee3a</id>
<content type='text'>
Currently when converting extent to initialized, we have to decide
whether to zeroout part/all of the uninitialized extent in order to
avoid extent tree growing rapidly.

The decision is made by comparing the size of the extent with the
configurable value s_extent_max_zeroout_kb which is in kibibytes units.

However when converting it to number of blocks we currently use it as it
was in bytes. This is obviously bug and it will result in ext4 _never_
zeroout extents, but rather always split and convert parts to
initialized while leaving the rest uninitialized in default setting.

Fix this by using s_extent_max_zeroout_kb as kibibytes.

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: use atomic64_t for the per-flexbg free_clusters count</title>
<updated>2013-03-12T03:39:59Z</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=90ba983f6889e65a3b506b30dc606aa9d1d46cd2'/>
<id>urn:sha1:90ba983f6889e65a3b506b30dc606aa9d1d46cd2</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: reserve metadata block for every delayed write</title>
<updated>2013-03-11T02:50:00Z</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2013-03-11T02:50:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=386ad67c9ac043890121c066186883d1640348a4'/>
<id>urn:sha1:386ad67c9ac043890121c066186883d1640348a4</id>
<content type='text'>
Currently we only reserve space (data+metadata) in delayed allocation if
we're allocating from new cluster (which is always in non-bigalloc file
system) which is ok for data blocks, because we reserve the whole cluster.

However we have to reserve metadata for every delayed block we're going
to write because every block could potentially require metedata block
when we need to grow the extent tree.

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
</content>
</entry>
<entry>
<title>ext4: update reserved space after the 'correction'</title>
<updated>2013-03-11T02:46:30Z</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2013-03-11T02:46:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=232ec8720d4e45405e37144c67053042c6b886d3'/>
<id>urn:sha1:232ec8720d4e45405e37144c67053042c6b886d3</id>
<content type='text'>
Currently in ext4_ext_map_blocks() in delayed allocation writeback
we would update the reservation and after that check whether we claimed
cluster outside of the range of the allocation and if so, we'll give the
block back to the reservation pool.

However this also means that if the number of reserved data block
dropped to zero before the correction, we would release all the metadata
reservation as well, however we might still need it because the we're
not done with the delayed allocation and there might be more blocks to
come. This will result in error messages such as:

EXT4-fs warning (device sdb): ext4_da_update_reserve_space:361: ino 12,
allocated 1 with only 0 reserved metadata blocks (releasing 1 blocks
with reserved 1 data blocks)

This will only happen on bigalloc file system and it can be easily
reproduced using fiemap-tester from xfstests like this:

./src/fiemap-tester -m DHDHDHDHD -S -p0 /mnt/test/file

Or using xfstests such as 225.

Fix this by doing the correction first and updating the reservation
after that so that we do not accidentally decrease
i_reserved_data_blocks to zero.

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
