<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/fs, branch v3.12.6</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.6</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.6'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-12-20T15:49:09Z</updated>
<entry>
<title>Btrfs: fix lockdep error in async commit</title>
<updated>2013-12-20T15:49:09Z</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2013-11-06T08:57:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5298b6d3c8abeee370055238d1ede81ec4daebc5'/>
<id>urn:sha1:5298b6d3c8abeee370055238d1ede81ec4daebc5</id>
<content type='text'>
commit b1a06a4b574996692b72b742bf6e6aa0c711a948 upstream.

Lockdep complains about btrfs's async commit:

[ 2372.462171] [ BUG: bad unlock balance detected! ]
[ 2372.462191] 3.12.0+ #32 Tainted: G        W
[ 2372.462209] -------------------------------------
[ 2372.462228] ceph-osd/14048 is trying to release lock (sb_internal) at:
[ 2372.462275] [&lt;ffffffffa022cb10&gt;] btrfs_commit_transaction_async+0x1b0/0x2a0 [btrfs]
[ 2372.462305] but there are no more locks to release!
[ 2372.462324]
[ 2372.462324] other info that might help us debug this:
[ 2372.462349] no locks held by ceph-osd/14048.
[ 2372.462367]
[ 2372.462367] stack backtrace:
[ 2372.462386] CPU: 2 PID: 14048 Comm: ceph-osd Tainted: G        W    3.12.0+ #32
[ 2372.462414] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080015  11/09/2011
[ 2372.462455]  ffffffffa022cb10 ffff88007490fd28 ffffffff816f094a ffff8800378aa320
[ 2372.462491]  ffff88007490fd50 ffffffff810adf4c ffff8800378aa320 ffff88009af97650
[ 2372.462526]  ffffffffa022cb10 ffff88007490fd88 ffffffff810b01ee ffff8800898c0000
[ 2372.462562] Call Trace:
[ 2372.462584]  [&lt;ffffffffa022cb10&gt;] ? btrfs_commit_transaction_async+0x1b0/0x2a0 [btrfs]
[ 2372.462619]  [&lt;ffffffff816f094a&gt;] dump_stack+0x45/0x56
[ 2372.462642]  [&lt;ffffffff810adf4c&gt;] print_unlock_imbalance_bug+0xec/0x100
[ 2372.462677]  [&lt;ffffffffa022cb10&gt;] ? btrfs_commit_transaction_async+0x1b0/0x2a0 [btrfs]
[ 2372.462710]  [&lt;ffffffff810b01ee&gt;] lock_release+0x18e/0x210
[ 2372.462742]  [&lt;ffffffffa022cb36&gt;] btrfs_commit_transaction_async+0x1d6/0x2a0 [btrfs]
[ 2372.462783]  [&lt;ffffffffa025a7ce&gt;] btrfs_ioctl_start_sync+0x3e/0xc0 [btrfs]
[ 2372.462822]  [&lt;ffffffffa025f1d3&gt;] btrfs_ioctl+0x4c3/0x1f70 [btrfs]
[ 2372.462849]  [&lt;ffffffff812c0321&gt;] ? avc_has_perm+0x121/0x1b0
[ 2372.462873]  [&lt;ffffffff812c0224&gt;] ? avc_has_perm+0x24/0x1b0
[ 2372.462897]  [&lt;ffffffff8107ecc8&gt;] ? sched_clock_cpu+0xa8/0x100
[ 2372.462922]  [&lt;ffffffff8117b145&gt;] do_vfs_ioctl+0x2e5/0x4e0
[ 2372.462946]  [&lt;ffffffff812c19e6&gt;] ? file_has_perm+0x86/0xa0
[ 2372.462969]  [&lt;ffffffff8117b3c1&gt;] SyS_ioctl+0x81/0xa0
[ 2372.462991]  [&lt;ffffffff817045a4&gt;] tracesys+0xdd/0xe2

====================================================

It's because that we don't do the right thing when checking if it's ok to
tell lockdep that we're trying to release the rwsem.

If the trans handle's type is TRANS_ATTACH, we won't acquire the freeze rwsem, but
as TRANS_ATTACH fits the check (trans &lt; TRANS_JOIN_NOLOCK), we'll release the freeze
rwsem, which makes lockdep complains a lot.

Reported-by: Ma Jianpeng &lt;majianpeng@gmail.com&gt;
Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: fix a crash when running balance and defrag concurrently</title>
<updated>2013-12-20T15:49:09Z</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2013-10-30T05:25:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6f01df1850af8131a45bcd8f87b58d937af5140c'/>
<id>urn:sha1:6f01df1850af8131a45bcd8f87b58d937af5140c</id>
<content type='text'>
commit 48ec47364b6d493f0a9cdc116977bf3f34e5c3ec upstream.

Running balance and defrag concurrently can end up with a crash:

kernel BUG at fs/btrfs/relocation.c:4528!
RIP: 0010:[&lt;ffffffffa01ac33b&gt;]  [&lt;ffffffffa01ac33b&gt;] btrfs_reloc_cow_block+ 0x1eb/0x230 [btrfs]
Call Trace:
  [&lt;ffffffffa01398c1&gt;] ? update_ref_for_cow+0x241/0x380 [btrfs]
  [&lt;ffffffffa0180bad&gt;] ? copy_extent_buffer+0xad/0x110 [btrfs]
  [&lt;ffffffffa0139da1&gt;] __btrfs_cow_block+0x3a1/0x520 [btrfs]
  [&lt;ffffffffa013a0b6&gt;] btrfs_cow_block+0x116/0x1b0 [btrfs]
  [&lt;ffffffffa013ddad&gt;] btrfs_search_slot+0x43d/0x970 [btrfs]
  [&lt;ffffffffa0153c57&gt;] btrfs_lookup_file_extent+0x37/0x40 [btrfs]
  [&lt;ffffffffa0172a5e&gt;] __btrfs_drop_extents+0x11e/0xae0 [btrfs]
  [&lt;ffffffffa013b3fd&gt;] ? generic_bin_search.constprop.39+0x8d/0x1a0 [btrfs]
  [&lt;ffffffff8117d14a&gt;] ? kmem_cache_alloc+0x1da/0x200
  [&lt;ffffffffa0138e7a&gt;] ? btrfs_alloc_path+0x1a/0x20 [btrfs]
  [&lt;ffffffffa0173ef0&gt;] btrfs_drop_extents+0x60/0x90 [btrfs]
  [&lt;ffffffffa016b24d&gt;] relink_extent_backref+0x2ed/0x780 [btrfs]
  [&lt;ffffffffa0162fe0&gt;] ? btrfs_submit_bio_hook+0x1e0/0x1e0 [btrfs]
  [&lt;ffffffffa01b8ed7&gt;] ? iterate_inodes_from_logical+0x87/0xa0 [btrfs]
  [&lt;ffffffffa016b909&gt;] btrfs_finish_ordered_io+0x229/0xac0 [btrfs]
  [&lt;ffffffffa016c3b5&gt;] finish_ordered_fn+0x15/0x20 [btrfs]
  [&lt;ffffffffa018cbe5&gt;] worker_loop+0x125/0x4e0 [btrfs]
  [&lt;ffffffffa018cac0&gt;] ? btrfs_queue_worker+0x300/0x300 [btrfs]
  [&lt;ffffffff81075ea0&gt;] kthread+0xc0/0xd0
  [&lt;ffffffff81075de0&gt;] ? insert_kthread_work+0x40/0x40
  [&lt;ffffffff8164796c&gt;] ret_from_fork+0x7c/0xb0
  [&lt;ffffffff81075de0&gt;] ? insert_kthread_work+0x40/0x40
----------------------------------------------------------------------

It turns out to be that balance operation will bump root's @last_snapshot,
which enables snapshot-aware defrag path, and backref walking stuff will
find data reloc tree as refs' parent, and hit the BUG_ON() during COW.

As data reloc tree's data is just for relocation purpose, and will be deleted right
after relocation is done, it's unnecessary to walk those refs belonged to data reloc
tree, it'd be better to skip them.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: do not run snapshot-aware defragment on error</title>
<updated>2013-12-20T15:49:09Z</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2013-10-29T02:45:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9e5787dec9c785cc58e27c03d9c3e5536d18698a'/>
<id>urn:sha1:9e5787dec9c785cc58e27c03d9c3e5536d18698a</id>
<content type='text'>
commit 6f519564d7d978c00351d9ab6abac3deeac31621 upstream.

If something wrong happens in write endio, running snapshot-aware defragment
can end up with undefined results, maybe a crash, so we should avoid it.

In order to share similar code, this also adds a helper to free the struct for
snapshot-aware defrag.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: take ordered root lock when removing ordered operations inode</title>
<updated>2013-12-20T15:49:09Z</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fusionio.com</email>
</author>
<published>2013-10-28T13:13:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=486d1e163be2d32150a053c7ac3fc853ba6fd998'/>
<id>urn:sha1:486d1e163be2d32150a053c7ac3fc853ba6fd998</id>
<content type='text'>
commit 93858769172c4e3678917810e9d5de360eb991cc upstream.

A user reported a list corruption warning from btrfs_remove_ordered_extent, it
is because we aren't taking the ordered_root_lock when we remove the inode from
the ordered operations list.  Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: stop using vfs_read in send</title>
<updated>2013-12-20T15:49:09Z</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fusionio.com</email>
</author>
<published>2013-10-25T15:36:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=222ae8bfd4c3796335d2aa1aa6a4dbeccb497b00'/>
<id>urn:sha1:222ae8bfd4c3796335d2aa1aa6a4dbeccb497b00</id>
<content type='text'>
commit ed2590953bd06b892f0411fc94e19175d32f197a upstream.

Apparently we don't actually close the files until we return to userspace, so
stop using vfs_read in send.  This is actually better for us since we can avoid
all the extra logic of holding the file we're sending open and making sure to
clean it up.  This will fix people who have been hitting too many files open
errors when trying to send.  Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: fix incorrect inode acl reset</title>
<updated>2013-12-20T15:49:08Z</updated>
<author>
<name>Filipe David Borba Manana</name>
<email>fdmanana@gmail.com</email>
</author>
<published>2013-10-15T17:44:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7673c22871fdd914cdb61c9c1cd273ad59f614af'/>
<id>urn:sha1:7673c22871fdd914cdb61c9c1cd273ad59f614af</id>
<content type='text'>
commit 8185554d3eb09d23a805456b6fa98dcbb34aa518 upstream.

When a directory has a default ACL and a subdirectory is created
under that directory, btrfs_init_acl() is called when the
subdirectory's inode is created to initialize the inode's ACL
(inherited from the parent directory) but it was clearing the ACL
from the inode after setting it if posix_acl_create() returned
success, instead of clearing it only if it returned an error.

To reproduce this issue:

$ mkfs.btrfs -f /dev/loop0
$ mount /dev/loop0 /mnt
$ mkdir /mnt/acl
$ setfacl -d --set u::rwx,g::rwx,o::- /mnt/acl
$ getfacl /mnt/acl
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::---

$ mkdir /mnt/acl/dir1
$ getfacl /mnt/acl/dir1
user::rwx
group::rwx
other::---

After unmounting and mounting again the filesystem, fgetacl returned the
expected ACL:

$ umount /mnt/acl
$ mount /dev/loop0 /mnt
$ getfacl /mnt/acl/dir1
user::rwx
group::rwx
other::---
default:user::rwx
default:group::rwx
default:other::---

Meaning that the underlying xattr was persisted.

Reported-by: Giuseppe Fierro &lt;giuseppe@fierro.org&gt;
Signed-off-by: Filipe David Borba Manana &lt;fdmanana@gmail.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: fix hole check in log_one_extent</title>
<updated>2013-12-20T15:49:08Z</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fusionio.com</email>
</author>
<published>2013-10-14T21:23:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=63e431def463a8c620d1b03c77d440c6903917d1'/>
<id>urn:sha1:63e431def463a8c620d1b03c77d440c6903917d1</id>
<content type='text'>
commit ed9e8af88e2551aaa6bf51d8063a2493e2d71597 upstream.

I added an assert to make sure we were looking up aligned offsets for csums and
I tripped it when running xfstests.  This is because log_one_extent was checking
if block_start == 0 for a hole instead of EXTENT_MAP_HOLE.  This worked out fine
in practice it seems, but it adds a lot of extra work that is uneeded.  With
this fix I'm no longer tripping my assert.  Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: fix memory leak of chunks' extent map</title>
<updated>2013-12-20T15:49:08Z</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2013-09-29T02:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4ae8656075c351ba3a3aefc923550ef2b7280164'/>
<id>urn:sha1:4ae8656075c351ba3a3aefc923550ef2b7280164</id>
<content type='text'>
commit 7d3d1744f8a7d62e4875bd69cc2192a939813880 upstream.

As we're hold a ref on looking up the extent map, we need to drop the ref
before returning to callers.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: reset intwrite on transaction abort</title>
<updated>2013-12-20T15:49:08Z</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fusionio.com</email>
</author>
<published>2013-09-21T02:26:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=15c7298ad21e91b0ac7e3fcf753b036d178f8c7e'/>
<id>urn:sha1:15c7298ad21e91b0ac7e3fcf753b036d178f8c7e</id>
<content type='text'>
commit e0228285a8cad70e4b7b4833cc650e36ecd8de89 upstream.

If we abort a transaction in the middle of a commit we weren't undoing the
intwrite locking.  This patch fixes that problem.

Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: do a full search everytime in btrfs_search_old_slot</title>
<updated>2013-12-20T15:49:08Z</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fusionio.com</email>
</author>
<published>2013-09-24T18:09:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=794d0e92d22e8dd6495d22674272e17fd3cc33fa'/>
<id>urn:sha1:794d0e92d22e8dd6495d22674272e17fd3cc33fa</id>
<content type='text'>
commit d4b4087c43cc00a196c5be57fac41f41309f1d56 upstream.

While running some snashot aware defrag tests I noticed I was panicing every
once and a while in key_search.  This is because of the optimization that says
if we find a key at slot 0 it will be at slot 0 all the way down the rest of the
tree.  This isn't the case for btrfs_search_old_slot since it will likely replay
changes to a buffer if something has changed since we took our sequence number.
So short circuit this optimization by setting prev_cmp to -1 every time we call
key_search so we will do our normal binary search.  With this patch I am no
longer seeing the panics I was seeing before.  Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fusionio.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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