<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs, branch v3.12.25</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>ext4: fix a potential deadlock in __ext4_es_shrink()</title>
<updated>2014-07-18T13:51:27+00:00</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2014-07-12T19:32:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e4b456d4e61e7f663f5e88849f5002ba685ba359'/>
<id>e4b456d4e61e7f663f5e88849f5002ba685ba359</id>
<content type='text'>
commit 3f1f9b851311a76226140b55b1ea22111234a7c2 upstream.

This fixes the following lockdep complaint:

[ INFO: possible circular locking dependency detected ]
3.16.0-rc2-mm1+ #7 Tainted: G           O
-------------------------------------------------------
kworker/u24:0/4356 is trying to acquire lock:
 (&amp;(&amp;sbi-&gt;s_es_lru_lock)-&gt;rlock){+.+.-.}, at: [&lt;ffffffff81285fff&gt;] __ext4_es_shrink+0x4f/0x2e0

but task is already holding lock:
 (&amp;ei-&gt;i_es_lock){++++-.}, at: [&lt;ffffffff81286961&gt;] ext4_es_insert_extent+0x71/0x180

which lock already depends on the new lock.

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;ei-&gt;i_es_lock);
                               lock(&amp;(&amp;sbi-&gt;s_es_lru_lock)-&gt;rlock);
                               lock(&amp;ei-&gt;i_es_lock);
  lock(&amp;(&amp;sbi-&gt;s_es_lru_lock)-&gt;rlock);

 *** DEADLOCK ***

6 locks held by kworker/u24:0/4356:
 #0:  ("writeback"){.+.+.+}, at: [&lt;ffffffff81071d00&gt;] process_one_work+0x180/0x560
 #1:  ((&amp;(&amp;wb-&gt;dwork)-&gt;work)){+.+.+.}, at: [&lt;ffffffff81071d00&gt;] process_one_work+0x180/0x560
 #2:  (&amp;type-&gt;s_umount_key#22){++++++}, at: [&lt;ffffffff811a9c74&gt;] grab_super_passive+0x44/0x90
 #3:  (jbd2_handle){+.+...}, at: [&lt;ffffffff812979f9&gt;] start_this_handle+0x189/0x5f0
 #4:  (&amp;ei-&gt;i_data_sem){++++..}, at: [&lt;ffffffff81247062&gt;] ext4_map_blocks+0x132/0x550
 #5:  (&amp;ei-&gt;i_es_lock){++++-.}, at: [&lt;ffffffff81286961&gt;] ext4_es_insert_extent+0x71/0x180

stack backtrace:
CPU: 0 PID: 4356 Comm: kworker/u24:0 Tainted: G           O   3.16.0-rc2-mm1+ #7
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Workqueue: writeback bdi_writeback_workfn (flush-253:0)
 ffffffff8213dce0 ffff880014b07538 ffffffff815df0bb 0000000000000007
 ffffffff8213e040 ffff880014b07588 ffffffff815db3dd ffff880014b07568
 ffff880014b07610 ffff88003b868930 ffff88003b868908 ffff88003b868930
Call Trace:
 [&lt;ffffffff815df0bb&gt;] dump_stack+0x4e/0x68
 [&lt;ffffffff815db3dd&gt;] print_circular_bug+0x1fb/0x20c
 [&lt;ffffffff810a7a3e&gt;] __lock_acquire+0x163e/0x1d00
 [&lt;ffffffff815e89dc&gt;] ? retint_restore_args+0xe/0xe
 [&lt;ffffffff815ddc7b&gt;] ? __slab_alloc+0x4a8/0x4ce
 [&lt;ffffffff81285fff&gt;] ? __ext4_es_shrink+0x4f/0x2e0
 [&lt;ffffffff810a8707&gt;] lock_acquire+0x87/0x120
 [&lt;ffffffff81285fff&gt;] ? __ext4_es_shrink+0x4f/0x2e0
 [&lt;ffffffff8128592d&gt;] ? ext4_es_free_extent+0x5d/0x70
 [&lt;ffffffff815e6f09&gt;] _raw_spin_lock+0x39/0x50
 [&lt;ffffffff81285fff&gt;] ? __ext4_es_shrink+0x4f/0x2e0
 [&lt;ffffffff8119760b&gt;] ? kmem_cache_alloc+0x18b/0x1a0
 [&lt;ffffffff81285fff&gt;] __ext4_es_shrink+0x4f/0x2e0
 [&lt;ffffffff812869b8&gt;] ext4_es_insert_extent+0xc8/0x180
 [&lt;ffffffff812470f4&gt;] ext4_map_blocks+0x1c4/0x550
 [&lt;ffffffff8124c4c4&gt;] ext4_writepages+0x6d4/0xd00
	...

Reported-by: Minchan Kim &lt;minchan@kernel.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reported-by: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Zheng Liu &lt;gnehzuil.liu@gmail.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3f1f9b851311a76226140b55b1ea22111234a7c2 upstream.

This fixes the following lockdep complaint:

[ INFO: possible circular locking dependency detected ]
3.16.0-rc2-mm1+ #7 Tainted: G           O
-------------------------------------------------------
kworker/u24:0/4356 is trying to acquire lock:
 (&amp;(&amp;sbi-&gt;s_es_lru_lock)-&gt;rlock){+.+.-.}, at: [&lt;ffffffff81285fff&gt;] __ext4_es_shrink+0x4f/0x2e0

but task is already holding lock:
 (&amp;ei-&gt;i_es_lock){++++-.}, at: [&lt;ffffffff81286961&gt;] ext4_es_insert_extent+0x71/0x180

which lock already depends on the new lock.

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;ei-&gt;i_es_lock);
                               lock(&amp;(&amp;sbi-&gt;s_es_lru_lock)-&gt;rlock);
                               lock(&amp;ei-&gt;i_es_lock);
  lock(&amp;(&amp;sbi-&gt;s_es_lru_lock)-&gt;rlock);

 *** DEADLOCK ***

6 locks held by kworker/u24:0/4356:
 #0:  ("writeback"){.+.+.+}, at: [&lt;ffffffff81071d00&gt;] process_one_work+0x180/0x560
 #1:  ((&amp;(&amp;wb-&gt;dwork)-&gt;work)){+.+.+.}, at: [&lt;ffffffff81071d00&gt;] process_one_work+0x180/0x560
 #2:  (&amp;type-&gt;s_umount_key#22){++++++}, at: [&lt;ffffffff811a9c74&gt;] grab_super_passive+0x44/0x90
 #3:  (jbd2_handle){+.+...}, at: [&lt;ffffffff812979f9&gt;] start_this_handle+0x189/0x5f0
 #4:  (&amp;ei-&gt;i_data_sem){++++..}, at: [&lt;ffffffff81247062&gt;] ext4_map_blocks+0x132/0x550
 #5:  (&amp;ei-&gt;i_es_lock){++++-.}, at: [&lt;ffffffff81286961&gt;] ext4_es_insert_extent+0x71/0x180

stack backtrace:
CPU: 0 PID: 4356 Comm: kworker/u24:0 Tainted: G           O   3.16.0-rc2-mm1+ #7
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Workqueue: writeback bdi_writeback_workfn (flush-253:0)
 ffffffff8213dce0 ffff880014b07538 ffffffff815df0bb 0000000000000007
 ffffffff8213e040 ffff880014b07588 ffffffff815db3dd ffff880014b07568
 ffff880014b07610 ffff88003b868930 ffff88003b868908 ffff88003b868930
Call Trace:
 [&lt;ffffffff815df0bb&gt;] dump_stack+0x4e/0x68
 [&lt;ffffffff815db3dd&gt;] print_circular_bug+0x1fb/0x20c
 [&lt;ffffffff810a7a3e&gt;] __lock_acquire+0x163e/0x1d00
 [&lt;ffffffff815e89dc&gt;] ? retint_restore_args+0xe/0xe
 [&lt;ffffffff815ddc7b&gt;] ? __slab_alloc+0x4a8/0x4ce
 [&lt;ffffffff81285fff&gt;] ? __ext4_es_shrink+0x4f/0x2e0
 [&lt;ffffffff810a8707&gt;] lock_acquire+0x87/0x120
 [&lt;ffffffff81285fff&gt;] ? __ext4_es_shrink+0x4f/0x2e0
 [&lt;ffffffff8128592d&gt;] ? ext4_es_free_extent+0x5d/0x70
 [&lt;ffffffff815e6f09&gt;] _raw_spin_lock+0x39/0x50
 [&lt;ffffffff81285fff&gt;] ? __ext4_es_shrink+0x4f/0x2e0
 [&lt;ffffffff8119760b&gt;] ? kmem_cache_alloc+0x18b/0x1a0
 [&lt;ffffffff81285fff&gt;] __ext4_es_shrink+0x4f/0x2e0
 [&lt;ffffffff812869b8&gt;] ext4_es_insert_extent+0xc8/0x180
 [&lt;ffffffff812470f4&gt;] ext4_map_blocks+0x1c4/0x550
 [&lt;ffffffff8124c4c4&gt;] ext4_writepages+0x6d4/0xd00
	...

Reported-by: Minchan Kim &lt;minchan@kernel.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reported-by: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Zheng Liu &lt;gnehzuil.liu@gmail.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: disable synchronous transaction batching if max_batch_time==0</title>
<updated>2014-07-18T13:51:26+00:00</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@redhat.com</email>
</author>
<published>2014-07-05T23:18:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=38020539004ac2a24e1183f37fabd0dc9c657f5f'/>
<id>38020539004ac2a24e1183f37fabd0dc9c657f5f</id>
<content type='text'>
commit 5dd214248f94d430d70e9230bda72f2654ac88a8 upstream.

The mount manpage says of the max_batch_time option,

	This optimization can be turned off entirely
	by setting max_batch_time to 0.

But the code doesn't do that.  So fix the code to do
that.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5dd214248f94d430d70e9230bda72f2654ac88a8 upstream.

The mount manpage says of the max_batch_time option,

	This optimization can be turned off entirely
	by setting max_batch_time to 0.

But the code doesn't do that.  So fix the code to do
that.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: clarify ext4_error message in ext4_mb_generate_buddy_error()</title>
<updated>2014-07-18T13:51:26+00:00</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2014-07-05T23:15:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5795af2e8a16321e5eb9877e3c96510e2184abf4'/>
<id>5795af2e8a16321e5eb9877e3c96510e2184abf4</id>
<content type='text'>
commit 94d4c066a4ff170a2671b1a9b153febbf36796f6 upstream.

We are spending a lot of time explaining to users what this error
means.  Let's try to improve the message to avoid this problem.

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 94d4c066a4ff170a2671b1a9b153febbf36796f6 upstream.

We are spending a lot of time explaining to users what this error
means.  Let's try to improve the message to avoid this problem.

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: clarify error count warning messages</title>
<updated>2014-07-18T13:51:25+00:00</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2014-07-05T22:40:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f17c60ee789dab6e7233ec9b13ef566cf964141f'/>
<id>f17c60ee789dab6e7233ec9b13ef566cf964141f</id>
<content type='text'>
commit ae0f78de2c43b6fadd007c231a352b13b5be8ed2 upstream.

Make it clear that values printed are times, and that it is error
since last fsck. Also add note about fsck version required.

Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reviewed-by: Andreas Dilger &lt;adilger@dilger.ca&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ae0f78de2c43b6fadd007c231a352b13b5be8ed2 upstream.

Make it clear that values printed are times, and that it is error
since last fsck. Also add note about fsck version required.

Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reviewed-by: Andreas Dilger &lt;adilger@dilger.ca&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: fix unjournalled bg descriptor while initializing inode bitmap</title>
<updated>2014-07-18T13:51:25+00:00</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2014-07-05T20:28:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=95f670b4b379ad85b0dacc9e7b724422df1b53f6'/>
<id>95f670b4b379ad85b0dacc9e7b724422df1b53f6</id>
<content type='text'>
commit 61c219f5814277ecb71d64cb30297028d6665979 upstream.

The first time that we allocate from an uninitialized inode allocation
bitmap, if the block allocation bitmap is also uninitalized, we need
to get write access to the block group descriptor before we start
modifying the block group descriptor flags and updating the free block
count, etc.  Otherwise, there is the potential of a bad journal
checksum (if journal checksums are enabled), and of the file system
becoming inconsistent if we crash at exactly the wrong time.

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 61c219f5814277ecb71d64cb30297028d6665979 upstream.

The first time that we allocate from an uninitialized inode allocation
bitmap, if the block allocation bitmap is also uninitalized, we need
to get write access to the block group descriptor before we start
modifying the block group descriptor flags and updating the free block
count, etc.  Otherwise, there is the potential of a bad journal
checksum (if journal checksums are enabled), and of the file system
becoming inconsistent if we crash at exactly the wrong time.

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd: fix rare symlink decoding bug</title>
<updated>2014-07-18T13:51:06+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2014-06-19T20:44:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=12ea90016aa96ea84080e250cfff45d865da540c'/>
<id>12ea90016aa96ea84080e250cfff45d865da540c</id>
<content type='text'>
commit 76f47128f9b33af1e96819746550d789054c9664 upstream.

An NFS operation that creates a new symlink includes the symlink data,
which is xdr-encoded as a length followed by the data plus 0 to 3 bytes
of zero-padding as required to reach a 4-byte boundary.

The vfs, on the other hand, wants null-terminated data.

The simple way to handle this would be by copying the data into a newly
allocated buffer with space for the final null.

The current nfsd_symlink code tries to be more clever by skipping that
step in the (likely) case where the byte following the string is already
0.

But that assumes that the byte following the string is ours to look at.
In fact, it might be the first byte of a page that we can't read, or of
some object that another task might modify.

Worse, the NFSv4 code tries to fix the problem by actually writing to
that byte.

In the NFSv2/v3 cases this actually appears to be safe:

	- nfs3svc_decode_symlinkargs explicitly null-terminates the data
	  (after first checking its length and copying it to a new
	  page).
	- NFSv2 limits symlinks to 1k.  The buffer holding the rpc
	  request is always at least a page, and the link data (and
	  previous fields) have maximum lengths that prevent the request
	  from reaching the end of a page.

In the NFSv4 case the CREATE op is potentially just one part of a long
compound so can end up on the end of a page if you're unlucky.

The minimal fix here is to copy and null-terminate in the NFSv4 case.
The nfsd_symlink() interface here seems too fragile, though.  It should
really either do the copy itself every time or just require a
null-terminated string.

Reported-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 76f47128f9b33af1e96819746550d789054c9664 upstream.

An NFS operation that creates a new symlink includes the symlink data,
which is xdr-encoded as a length followed by the data plus 0 to 3 bytes
of zero-padding as required to reach a 4-byte boundary.

The vfs, on the other hand, wants null-terminated data.

The simple way to handle this would be by copying the data into a newly
allocated buffer with space for the final null.

The current nfsd_symlink code tries to be more clever by skipping that
step in the (likely) case where the byte following the string is already
0.

But that assumes that the byte following the string is ours to look at.
In fact, it might be the first byte of a page that we can't read, or of
some object that another task might modify.

Worse, the NFSv4 code tries to fix the problem by actually writing to
that byte.

In the NFSv2/v3 cases this actually appears to be safe:

	- nfs3svc_decode_symlinkargs explicitly null-terminates the data
	  (after first checking its length and copying it to a new
	  page).
	- NFSv2 limits symlinks to 1k.  The buffer holding the rpc
	  request is always at least a page, and the link data (and
	  previous fields) have maximum lengths that prevent the request
	  from reaching the end of a page.

In the NFSv4 case the CREATE op is potentially just one part of a long
compound so can end up on the end of a page if you're unlucky.

The minimal fix here is to copy and null-terminate in the NFSv4 case.
The nfsd_symlink() interface here seems too fragile, though.  It should
really either do the copy itself every time or just require a
null-terminated string.

Reported-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: Fix hole punching for files with indirect blocks</title>
<updated>2014-07-18T13:51:05+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2014-06-26T16:30:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9011a645583adfa1f71f15ee68efb254dce2538d'/>
<id>9011a645583adfa1f71f15ee68efb254dce2538d</id>
<content type='text'>
commit a93cd4cf86466caa49cfe64607bea7f0bde3f916 upstream.

Hole punching code for files with indirect blocks wrongly computed
number of blocks which need to be cleared when traversing the indirect
block tree. That could result in punching more blocks than actually
requested and thus effectively cause a data loss. For example:

fallocate -n -p 10240000 4096

will punch the range 10240000 - 12632064 instead of the range 1024000 -
10244096. Fix the calculation.

Fixes: 8bad6fc813a3a5300f51369c39d315679fd88c72
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a93cd4cf86466caa49cfe64607bea7f0bde3f916 upstream.

Hole punching code for files with indirect blocks wrongly computed
number of blocks which need to be cleared when traversing the indirect
block tree. That could result in punching more blocks than actually
requested and thus effectively cause a data loss. For example:

fallocate -n -p 10240000 4096

will punch the range 10240000 - 12632064 instead of the range 1024000 -
10244096. Fix the calculation.

Fixes: 8bad6fc813a3a5300f51369c39d315679fd88c72
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: Fix buffer double free in ext4_alloc_branch()</title>
<updated>2014-07-18T13:51:04+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2014-06-16T03:46:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=18e64a6a372648b8f12a457805df7ee40510e278'/>
<id>18e64a6a372648b8f12a457805df7ee40510e278</id>
<content type='text'>
commit c5c7b8ddfbf8cb3b2291e515a34ab1b8982f5a2d upstream.

Error recovery in ext4_alloc_branch() calls ext4_forget() even for
buffer corresponding to indirect block it did not allocate. This leads
to brelse() being called twice for that buffer (once from ext4_forget()
and once from cleanup in ext4_ind_map_blocks()) leading to buffer use
count misaccounting. Eventually (but often much later because there
are other users of the buffer) we will see messages like:
VFS: brelse: Trying to free free buffer

Another manifestation of this problem is an error:
JBD2 unexpected failure: jbd2_journal_revoke: !buffer_revoked(bh);
inconsistent data on disk

The fix is easy - don't forget buffer we did not allocate. Also add an
explanatory comment because the indexing at ext4_alloc_branch() is
somewhat subtle.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c5c7b8ddfbf8cb3b2291e515a34ab1b8982f5a2d upstream.

Error recovery in ext4_alloc_branch() calls ext4_forget() even for
buffer corresponding to indirect block it did not allocate. This leads
to brelse() being called twice for that buffer (once from ext4_forget()
and once from cleanup in ext4_ind_map_blocks()) leading to buffer use
count misaccounting. Eventually (but often much later because there
are other users of the buffer) we will see messages like:
VFS: brelse: Trying to free free buffer

Another manifestation of this problem is an error:
JBD2 unexpected failure: jbd2_journal_revoke: !buffer_revoked(bh);
inconsistent data on disk

The fix is easy - don't forget buffer we did not allocate. Also add an
explanatory comment because the indexing at ext4_alloc_branch() is
somewhat subtle.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option</title>
<updated>2014-07-18T13:51:03+00:00</updated>
<author>
<name>Steve French</name>
<email>smfrench@gmail.com</email>
</author>
<published>2014-06-23T01:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=10bdb522a256f5039785c80bf60868fb5cb505df'/>
<id>10bdb522a256f5039785c80bf60868fb5cb505df</id>
<content type='text'>
commit ce36d9ab3bab06b7b5522f5c8b68fac231b76ffb upstream.

When we SMB3 mounted with mapchars (to allow reserved characters : \ / &gt; &lt; * ?
via the Unicode Windows to POSIX remap range) empty paths
(eg when we open "" to query the root of the SMB3 directory on mount) were not
null terminated so we sent garbarge as a path name on empty paths which caused
SMB2/SMB2.1/SMB3 mounts to fail when mapchars was specified.  mapchars is
particularly important since Unix Extensions for SMB3 are not supported (yet)

Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Reviewed-by: David Disseldorp &lt;ddiss@suse.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ce36d9ab3bab06b7b5522f5c8b68fac231b76ffb upstream.

When we SMB3 mounted with mapchars (to allow reserved characters : \ / &gt; &lt; * ?
via the Unicode Windows to POSIX remap range) empty paths
(eg when we open "" to query the root of the SMB3 directory on mount) were not
null terminated so we sent garbarge as a path name on empty paths which caused
SMB2/SMB2.1/SMB3 mounts to fail when mapchars was specified.  mapchars is
particularly important since Unix Extensions for SMB3 are not supported (yet)

Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Reviewed-by: David Disseldorp &lt;ddiss@suse.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>reiserfs: call truncate_setsize under tailpack mutex</title>
<updated>2014-07-17T11:43:19+00:00</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.com</email>
</author>
<published>2014-05-21T17:28:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a4424b76ff576642a98409dd587631dd34891e62'/>
<id>a4424b76ff576642a98409dd587631dd34891e62</id>
<content type='text'>
commit 22e7478ddbcb670e33fab72d0bbe7c394c3a2c84 upstream.

Prior to commit 0e4f6a791b1e (Fix reiserfs_file_release()), reiserfs
truncates serialized on i_mutex. They mostly still do, with the exception
of reiserfs_file_release. That blocks out other writers via the tailpack
mutex and the inode openers counter adjusted in reiserfs_file_open.

However, NFS will call reiserfs_setattr without having called -&gt;open, so
we end up with a race when nfs is calling -&gt;setattr while another
process is releasing the file. Ultimately, it triggers the
BUG_ON(inode-&gt;i_size != new_file_size) check in maybe_indirect_to_direct.

The solution is to pull the lock into reiserfs_setattr to encompass the
truncate_setsize call as well.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 22e7478ddbcb670e33fab72d0bbe7c394c3a2c84 upstream.

Prior to commit 0e4f6a791b1e (Fix reiserfs_file_release()), reiserfs
truncates serialized on i_mutex. They mostly still do, with the exception
of reiserfs_file_release. That blocks out other writers via the tailpack
mutex and the inode openers counter adjusted in reiserfs_file_open.

However, NFS will call reiserfs_setattr without having called -&gt;open, so
we end up with a race when nfs is calling -&gt;setattr while another
process is releasing the file. Ultimately, it triggers the
BUG_ON(inode-&gt;i_size != new_file_size) check in maybe_indirect_to_direct.

The solution is to pull the lock into reiserfs_setattr to encompass the
truncate_setsize call as well.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</pre>
</div>
</content>
</entry>
</feed>
