<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs, branch v3.19-rc6</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>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2015-01-26T01:27:18+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-01-26T01:27:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=80a755545d54c8e9fd801f0de3d015defd825659'/>
<id>80a755545d54c8e9fd801f0de3d015defd825659</id>
<content type='text'>
Pull vfs fixes from Al Viro:
 "A couple of fixes - deadlock in CIFS and build breakage in cris serial
  driver (resurfaced f_dentry in there)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  VFS: Convert file-&gt;f_dentry-&gt;d_inode to file_inode()
  fix deadlock in cifs_ioctl_clone()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull vfs fixes from Al Viro:
 "A couple of fixes - deadlock in CIFS and build breakage in cris serial
  driver (resurfaced f_dentry in there)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  VFS: Convert file-&gt;f_dentry-&gt;d_inode to file_inode()
  fix deadlock in cifs_ioctl_clone()
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs</title>
<updated>2015-01-24T02:31:27+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-01-24T02:31:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c4e00f1d31c4c83d15162782491689229bd92527'/>
<id>c4e00f1d31c4c83d15162782491689229bd92527</id>
<content type='text'>
Pull btrfs fixes from Chris Mason:
 "We have a few fixes in my for-linus branch.

  Qu Wenruo's batch fix a regression between some our merge window pull
  and the inode_cache feature.  The rest are smaller bugs"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.
  btrfs: Fix the bug that fs_info-&gt;pending_changes is never cleared.
  btrfs: fix state-&gt;private cast on 32 bit machines
  Btrfs: fix race deleting block group from space_info-&gt;ro_bgs list
  Btrfs: fix incorrect freeing in scrub_stripe
  btrfs: sync ioctl, handle errors after transaction start
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull btrfs fixes from Chris Mason:
 "We have a few fixes in my for-linus branch.

  Qu Wenruo's batch fix a regression between some our merge window pull
  and the inode_cache feature.  The rest are smaller bugs"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.
  btrfs: Fix the bug that fs_info-&gt;pending_changes is never cleared.
  btrfs: fix state-&gt;private cast on 32 bit machines
  Btrfs: fix race deleting block group from space_info-&gt;ro_bgs list
  Btrfs: fix incorrect freeing in scrub_stripe
  btrfs: sync ioctl, handle errors after transaction start
</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.</title>
<updated>2015-01-21T01:20:21+00:00</updated>
<author>
<name>Qu Wenruo</name>
<email>quwenruo@cn.fujitsu.com</email>
</author>
<published>2015-01-19T07:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a53f4f8e9c8ebe6c9ee3b34c368913aae9876e22'/>
<id>a53f4f8e9c8ebe6c9ee3b34c368913aae9876e22</id>
<content type='text'>
Commit 6b5fe46dfa52 (btrfs: do commit in sync_fs if there are pending
changes) will call btrfs_start_transaction() in sync_fs(), to handle
some operations needed to be done in next transaction.

However this can cause deadlock if the filesystem is frozen, with the
following sys_r+w output:
[  143.255932] Call Trace:
[  143.255936]  [&lt;ffffffff816c0e09&gt;] schedule+0x29/0x70
[  143.255939]  [&lt;ffffffff811cb7f3&gt;] __sb_start_write+0xb3/0x100
[  143.255971]  [&lt;ffffffffa040ec06&gt;] start_transaction+0x2e6/0x5a0
[btrfs]
[  143.255992]  [&lt;ffffffffa040f1eb&gt;] btrfs_start_transaction+0x1b/0x20
[btrfs]
[  143.256003]  [&lt;ffffffffa03dc0ba&gt;] btrfs_sync_fs+0xca/0xd0 [btrfs]
[  143.256007]  [&lt;ffffffff811f7be0&gt;] sync_fs_one_sb+0x20/0x30
[  143.256011]  [&lt;ffffffff811cbd01&gt;] iterate_supers+0xe1/0xf0
[  143.256014]  [&lt;ffffffff811f7d75&gt;] sys_sync+0x55/0x90
[  143.256017]  [&lt;ffffffff816c49d2&gt;] system_call_fastpath+0x12/0x17
[  143.256111] Call Trace:
[  143.256114]  [&lt;ffffffff816c0e09&gt;] schedule+0x29/0x70
[  143.256119]  [&lt;ffffffff816c3405&gt;] rwsem_down_write_failed+0x1c5/0x2d0
[  143.256123]  [&lt;ffffffff8133f013&gt;] call_rwsem_down_write_failed+0x13/0x20
[  143.256131]  [&lt;ffffffff811caae8&gt;] thaw_super+0x28/0xc0
[  143.256135]  [&lt;ffffffff811db3e5&gt;] do_vfs_ioctl+0x3f5/0x540
[  143.256187]  [&lt;ffffffff811db5c1&gt;] SyS_ioctl+0x91/0xb0
[  143.256213]  [&lt;ffffffff816c49d2&gt;] system_call_fastpath+0x12/0x17

The reason is like the following:
(Holding s_umount)
VFS sync_fs staff:
|- btrfs_sync_fs()
   |- btrfs_start_transaction()
      |- sb_start_intwrite()
      (Waiting thaw_fs to unfreeze)
					VFS thaw_fs staff:
					thaw_fs()
					(Waiting sync_fs to release
					 s_umount)

So deadlock happens.
This can be easily triggered by fstest/generic/068 with inode_cache
mount option.

The fix is to check if the fs is frozen, if the fs is frozen, just
return and waiting for the next transaction.

Cc: David Sterba &lt;dsterba@suse.cz&gt;
Reported-by: Gui Hecheng &lt;guihc.fnst@cn.fujitsu.com&gt;
Signed-off-by: Qu Wenruo &lt;quwenruo@cn.fujitsu.com&gt;
[enhanced comment, changed to SB_FREEZE_WRITE]
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 6b5fe46dfa52 (btrfs: do commit in sync_fs if there are pending
changes) will call btrfs_start_transaction() in sync_fs(), to handle
some operations needed to be done in next transaction.

However this can cause deadlock if the filesystem is frozen, with the
following sys_r+w output:
[  143.255932] Call Trace:
[  143.255936]  [&lt;ffffffff816c0e09&gt;] schedule+0x29/0x70
[  143.255939]  [&lt;ffffffff811cb7f3&gt;] __sb_start_write+0xb3/0x100
[  143.255971]  [&lt;ffffffffa040ec06&gt;] start_transaction+0x2e6/0x5a0
[btrfs]
[  143.255992]  [&lt;ffffffffa040f1eb&gt;] btrfs_start_transaction+0x1b/0x20
[btrfs]
[  143.256003]  [&lt;ffffffffa03dc0ba&gt;] btrfs_sync_fs+0xca/0xd0 [btrfs]
[  143.256007]  [&lt;ffffffff811f7be0&gt;] sync_fs_one_sb+0x20/0x30
[  143.256011]  [&lt;ffffffff811cbd01&gt;] iterate_supers+0xe1/0xf0
[  143.256014]  [&lt;ffffffff811f7d75&gt;] sys_sync+0x55/0x90
[  143.256017]  [&lt;ffffffff816c49d2&gt;] system_call_fastpath+0x12/0x17
[  143.256111] Call Trace:
[  143.256114]  [&lt;ffffffff816c0e09&gt;] schedule+0x29/0x70
[  143.256119]  [&lt;ffffffff816c3405&gt;] rwsem_down_write_failed+0x1c5/0x2d0
[  143.256123]  [&lt;ffffffff8133f013&gt;] call_rwsem_down_write_failed+0x13/0x20
[  143.256131]  [&lt;ffffffff811caae8&gt;] thaw_super+0x28/0xc0
[  143.256135]  [&lt;ffffffff811db3e5&gt;] do_vfs_ioctl+0x3f5/0x540
[  143.256187]  [&lt;ffffffff811db5c1&gt;] SyS_ioctl+0x91/0xb0
[  143.256213]  [&lt;ffffffff816c49d2&gt;] system_call_fastpath+0x12/0x17

The reason is like the following:
(Holding s_umount)
VFS sync_fs staff:
|- btrfs_sync_fs()
   |- btrfs_start_transaction()
      |- sb_start_intwrite()
      (Waiting thaw_fs to unfreeze)
					VFS thaw_fs staff:
					thaw_fs()
					(Waiting sync_fs to release
					 s_umount)

So deadlock happens.
This can be easily triggered by fstest/generic/068 with inode_cache
mount option.

The fix is to check if the fs is frozen, if the fs is frozen, just
return and waiting for the next transaction.

Cc: David Sterba &lt;dsterba@suse.cz&gt;
Reported-by: Gui Hecheng &lt;guihc.fnst@cn.fujitsu.com&gt;
Signed-off-by: Qu Wenruo &lt;quwenruo@cn.fujitsu.com&gt;
[enhanced comment, changed to SB_FREEZE_WRITE]
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: Fix the bug that fs_info-&gt;pending_changes is never cleared.</title>
<updated>2015-01-21T01:19:40+00:00</updated>
<author>
<name>Qu Wenruo</name>
<email>quwenruo@cn.fujitsu.com</email>
</author>
<published>2015-01-20T09:05:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6c9fe14f9d64cc12401a825a60ec5c5723496ca4'/>
<id>6c9fe14f9d64cc12401a825a60ec5c5723496ca4</id>
<content type='text'>
Fs_info-&gt;pending_changes is never cleared since the original code uses
cmpxchg(&amp;fs_info-&gt;pending_changes, 0, 0), which will only clear it if
pending_changes is already 0.

This will cause a lot of problem when mount it with inode_cache mount
option.
If the btrfs is mounted as inode_cache, pending_changes will always be
1, even when the fs is frozen.

Signed-off-by: Qu Wenruo &lt;quwenruo@cn.fujitsu.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fs_info-&gt;pending_changes is never cleared since the original code uses
cmpxchg(&amp;fs_info-&gt;pending_changes, 0, 0), which will only clear it if
pending_changes is already 0.

This will cause a lot of problem when mount it with inode_cache mount
option.
If the btrfs is mounted as inode_cache, pending_changes will always be
1, even when the fs is frozen.

Signed-off-by: Qu Wenruo &lt;quwenruo@cn.fujitsu.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: fix state-&gt;private cast on 32 bit machines</title>
<updated>2015-01-19T21:06:06+00:00</updated>
<author>
<name>Satoru Takeuchi</name>
<email>takeuchi_satoru@jp.fujitsu.com</email>
</author>
<published>2014-12-25T09:21:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6e1103a6e9b19dbdc348077d04a546b626911fc5'/>
<id>6e1103a6e9b19dbdc348077d04a546b626911fc5</id>
<content type='text'>
Suppress the following warning displayed on building 32bit (i686) kernel.

===============================================================================
...
   CC [M]  fs/btrfs/extent_io.o
fs/btrfs/extent_io.c: In function ‘btrfs_free_io_failure_record’:
fs/btrfs/extent_io.c:2193:13: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
    failrec = (struct io_failure_record *)state-&gt;private;
...
===============================================================================

Signed-off-by: Satoru Takeuchi &lt;takeuchi_satoru@jp.fujitsu.com&gt;
Reported-by: Chris Murphy &lt;chris@colorremedies.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Suppress the following warning displayed on building 32bit (i686) kernel.

===============================================================================
...
   CC [M]  fs/btrfs/extent_io.o
fs/btrfs/extent_io.c: In function ‘btrfs_free_io_failure_record’:
fs/btrfs/extent_io.c:2193:13: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
    failrec = (struct io_failure_record *)state-&gt;private;
...
===============================================================================

Signed-off-by: Satoru Takeuchi &lt;takeuchi_satoru@jp.fujitsu.com&gt;
Reported-by: Chris Murphy &lt;chris@colorremedies.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix race deleting block group from space_info-&gt;ro_bgs list</title>
<updated>2015-01-19T21:05:45+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2015-01-16T13:24:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=75c68e9fbbdfc04467c9edcac76be998beaa630b'/>
<id>75c68e9fbbdfc04467c9edcac76be998beaa630b</id>
<content type='text'>
When removing a block group we were deleting it from its space_info's
ro_bgs list without the correct protection - the space info's spinlock.
Fix this by doing the list delete while holding the spinlock of the
corresponding space info, which is the correct lock for any operation
on that list.

This issue was introduced in the 3.19 kernel by the following change:

    Btrfs: move read only block groups onto their own list V2
    commit 633c0aad4c0243a506a3e8590551085ad78af82d

I ran into a kernel crash while a task was running statfs, which iterates
the space_info-&gt;ro_bgs list while holding the space info's spinlock,
and another task was deleting it from the same list, without holding that
spinlock, as part of the block group remove operation (while running the
function btrfs_remove_block_group). This happened often when running the
stress test xfstests/generic/038 I recently made.

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When removing a block group we were deleting it from its space_info's
ro_bgs list without the correct protection - the space info's spinlock.
Fix this by doing the list delete while holding the spinlock of the
corresponding space info, which is the correct lock for any operation
on that list.

This issue was introduced in the 3.19 kernel by the following change:

    Btrfs: move read only block groups onto their own list V2
    commit 633c0aad4c0243a506a3e8590551085ad78af82d

I ran into a kernel crash while a task was running statfs, which iterates
the space_info-&gt;ro_bgs list while holding the space info's spinlock,
and another task was deleting it from the same list, without holding that
spinlock, as part of the block group remove operation (while running the
function btrfs_remove_block_group). This happened often when running the
stress test xfstests/generic/038 I recently made.

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix incorrect freeing in scrub_stripe</title>
<updated>2015-01-19T21:05:44+00:00</updated>
<author>
<name>Tsutomu Itoh</name>
<email>t-itoh@jp.fujitsu.com</email>
</author>
<published>2015-01-09T08:37:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=379d6854a2092e38b6e56a8067d922e31461b7e2'/>
<id>379d6854a2092e38b6e56a8067d922e31461b7e2</id>
<content type='text'>
The address that should be freed is not 'ppath' but 'path'.

Signed-off-by: Tsutomu Itoh &lt;t-itoh@jp.fujitsu.com&gt;
Reviewed-by: Miao Xie &lt;miaoxie@huawei.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The address that should be freed is not 'ppath' but 'path'.

Signed-off-by: Tsutomu Itoh &lt;t-itoh@jp.fujitsu.com&gt;
Reviewed-by: Miao Xie &lt;miaoxie@huawei.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: sync ioctl, handle errors after transaction start</title>
<updated>2015-01-19T21:05:44+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.cz</email>
</author>
<published>2015-01-19T13:21:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=98bd5c547ef2300f915fc1adce5b6f25c195d4d4'/>
<id>98bd5c547ef2300f915fc1adce5b6f25c195d4d4</id>
<content type='text'>
The version merged to 3.19 did not handle errors from start_trancaction
and could pass an invalid pointer to commit_transaction.

Fixes: 6b5fe46dfa52441f ("btrfs: do commit in sync_fs if there are pending changes")
Reported-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The version merged to 3.19 did not handle errors from start_trancaction
and could pass an invalid pointer to commit_transaction.

Fixes: 6b5fe46dfa52441f ("btrfs: do commit in sync_fs if there are pending changes")
Reported-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix deadlock in cifs_ioctl_clone()</title>
<updated>2015-01-19T04:49:26+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-01-19T04:37:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=378ff1a53b5724f3ac97b0aba3c9ecac072f6fcd'/>
<id>378ff1a53b5724f3ac97b0aba3c9ecac072f6fcd</id>
<content type='text'>
It really needs to check that src is non-directory *and* use
{un,}lock_two_nodirectories().  As it is, it's trivial to cause
double-lock (ioctl(fd, CIFS_IOC_COPYCHUNK_FILE, fd)) and if the
last argument is an fd of directory, we are asking for trouble
by violating the locking order - all directories go before all
non-directories.  If the last argument is an fd of parent
directory, it has 50% odds of locking child before parent,
which will cause AB-BA deadlock if we race with unlink().

Cc: stable@vger.kernel.org @ 3.13+
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It really needs to check that src is non-directory *and* use
{un,}lock_two_nodirectories().  As it is, it's trivial to cause
double-lock (ioctl(fd, CIFS_IOC_COPYCHUNK_FILE, fd)) and if the
last argument is an fd of directory, we are asking for trouble
by violating the locking order - all directories go before all
non-directories.  If the last argument is an fd of parent
directory, it has 50% odds of locking child before parent,
which will cause AB-BA deadlock if we race with unlink().

Cc: stable@vger.kernel.org @ 3.13+
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core</title>
<updated>2015-01-16T19:16:52+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-01-16T19:16:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=62b1530065e9ced536ada063a4d0a748efa43cc8'/>
<id>62b1530065e9ced536ada063a4d0a748efa43cc8</id>
<content type='text'>
Pull driver core fix from Greg KH:
 "Here is one kernfs fix for a reported issue for 3.19-rc5.

  It has been in linux-next for a while"

* tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  kernfs: Fix kernfs_name_compare
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull driver core fix from Greg KH:
 "Here is one kernfs fix for a reported issue for 3.19-rc5.

  It has been in linux-next for a while"

* tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  kernfs: Fix kernfs_name_compare
</pre>
</div>
</content>
</entry>
</feed>
