<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs, branch linux-2.6.34.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.34.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.34.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-02-10T21:11:31Z</updated>
<entry>
<title>Btrfs: call the ordered free operation without any locks held</title>
<updated>2014-02-10T21:11:31Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2012-07-25T19:57:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c6577c482cfa98c8171c99d48606edf83736f150'/>
<id>urn:sha1:c6577c482cfa98c8171c99d48606edf83736f150</id>
<content type='text'>
commit e9fbcb42201c862fd6ab45c48ead4f47bb2dea9d upstream.

Each ordered operation has a free callback, and this was called with the
worker spinlock held.  Josef made the free callback also call iput,
which we can't do with the spinlock.

This drops the spinlock for the free operation and grabs it again before
moving through the rest of the list.  We'll circle back around to this
and find a cleaner way that doesn't bounce the lock around so much.

Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>btrfs: use rcu_barrier() to wait for bdev puts at unmount</title>
<updated>2014-02-10T21:11:31Z</updated>
<author>
<name>Eric Sandeen</name>
</author>
<published>2013-03-09T15:18:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=232efe16823d169342d8638b06b56ce15f3e1c14'/>
<id>urn:sha1:232efe16823d169342d8638b06b56ce15f3e1c14</id>
<content type='text'>
commit bc178622d40d87e75abc131007342429c9b03351 upstream.

Doing this would reliably fail with -EBUSY for me:

# mount /dev/sdb2 /mnt/scratch; umount /mnt/scratch; mkfs.btrfs -f /dev/sdb2
...
unable to open /dev/sdb2: Device or resource busy

because mkfs.btrfs tries to open the device O_EXCL, and somebody still has it.

Using systemtap to track bdev gets &amp; puts shows a kworker thread doing a
blkdev put after mkfs attempts a get; this is left over from the unmount
path:

btrfs_close_devices
	__btrfs_close_devices
		call_rcu(&amp;device-&gt;rcu, free_device);
			free_device
				INIT_WORK(&amp;device-&gt;rcu_work, __free_device);
				schedule_work(&amp;device-&gt;rcu_work);

so unmount might complete before __free_device fires &amp; does its blkdev_put.

Adding an rcu_barrier() to btrfs_close_devices() causes unmount to wait
until all blkdev_put()s are done, and the device is truly free once
unmount completes.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.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: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>btrfs: Require CAP_SYS_ADMIN for filesystem rebalance</title>
<updated>2012-03-14T14:57:48Z</updated>
<author>
<name>Ben Hutchings</name>
</author>
<published>2010-12-29T14:55:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7acbd73c63f2ace317abef386fd2568bfc28b82e'/>
<id>urn:sha1:7acbd73c63f2ace317abef386fd2568bfc28b82e</id>
<content type='text'>
commit 6f88a4403def422bd8e276ddf6863d6ac71435d2 upstream.

Filesystem rebalancing (BTRFS_IOC_BALANCE) affects the entire
filesystem and may run uninterruptibly for a long time.  This does not
seem to be something that an unprivileged user should be able to do.

Reported-by: Aron Xu &lt;happyaron.xu@gmail.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: Fix uninitialized root flags for subvolumes</title>
<updated>2012-03-14T14:56:58Z</updated>
<author>
<name>Li Zefan</name>
</author>
<published>2011-03-28T02:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8943a36416ea03f9f767c2e6b6a1e3f9dbd435d'/>
<id>urn:sha1:f8943a36416ea03f9f767c2e6b6a1e3f9dbd435d</id>
<content type='text'>
commit 08fe4db170b4193603d9d31f40ebaf652d07ac9c upstream.

root_item-&gt;flags and root_item-&gt;byte_limit are not initialized when
a subvolume is created. This bug is not revealed until we added
readonly snapshot support - now you mount a btrfs filesystem and you
may find the subvolumes in it are readonly.

To work around this problem, we steal a bit from root_item-&gt;inode_item-&gt;flags,
and use it to indicate if those fields have been properly initialized.
When we read a tree root from disk, we check if the bit is set, and if
not we'll set the flag and initialize the two fields of the root item.

Reported-by: Andreas Philipp &lt;philipp.andreas@gmail.com&gt;
Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Tested-by: Andreas Philipp &lt;philipp.andreas@gmail.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: fix checks in BTRFS_IOC_CLONE_RANGE</title>
<updated>2010-08-02T17:29:31Z</updated>
<author>
<name>Dan Rosenberg</name>
</author>
<published>2010-07-19T20:58:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b14f142dfd5131d98bba795474cd7eafa015161b'/>
<id>urn:sha1:b14f142dfd5131d98bba795474cd7eafa015161b</id>
<content type='text'>
commit 2ebc3464781ad24474abcbd2274e6254689853b5 upstream.

1.  The BTRFS_IOC_CLONE and BTRFS_IOC_CLONE_RANGE ioctls should check
whether the donor file is append-only before writing to it.

2.  The BTRFS_IOC_CLONE_RANGE ioctl appears to have an integer
overflow that allows a user to specify an out-of-bounds range to copy
from the source file (if off + len wraps around).  I haven't been able
to successfully exploit this, but I'd imagine that a clever attacker
could use this to read things he shouldn't.  Even if it's not
exploitable, it couldn't hurt to be safe.

Signed-off-by: Dan Rosenberg &lt;dan.j.rosenberg@gmail.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Btrfs: should add a permission check for setfacl</title>
<updated>2010-07-05T18:22:56Z</updated>
<author>
<name>Shi Weihua</name>
</author>
<published>2010-05-18T00:50:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99d690620ac4810b175f207a09044004bc2b4d79'/>
<id>urn:sha1:99d690620ac4810b175f207a09044004bc2b4d79</id>
<content type='text'>
commit 2f26afba46f0ebf155cf9be746496a0304a5b7cf upstream.

On btrfs, do the following
------------------
# su user1
# cd btrfs-part/
# touch aaa
# getfacl aaa
  # file: aaa
  # owner: user1
  # group: user1
  user::rw-
  group::rw-
  other::r--
# su user2
# cd btrfs-part/
# setfacl -m u::rwx aaa
# getfacl aaa
  # file: aaa
  # owner: user1
  # group: user1
  user::rwx           &lt;- successed to setfacl
  group::rw-
  other::r--
------------------
but we should prohibit it that user2 changing user1's acl.
In fact, on ext3 and other fs, a message occurs:
  setfacl: aaa: Operation not permitted

This patch fixed it.

Signed-off-by: Shi Weihua &lt;shiwh@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable</title>
<updated>2010-05-15T19:55:31Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2010-05-15T19:55:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18e41da89d55014d25b9a24502ee92b7f50599f9'/>
<id>urn:sha1:18e41da89d55014d25b9a24502ee92b7f50599f9</id>
<content type='text'>
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: check for read permission on src file in the clone ioctl
</content>
</entry>
<entry>
<title>Btrfs: check for read permission on src file in the clone ioctl</title>
<updated>2010-05-15T16:05:50Z</updated>
<author>
<name>Dan Rosenberg</name>
</author>
<published>2010-05-15T15:27:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5dc6416414fb3ec6e2825fd4d20c8bf1d7fe0395'/>
<id>urn:sha1:5dc6416414fb3ec6e2825fd4d20c8bf1d7fe0395</id>
<content type='text'>
The existing code would have allowed you to clone a file that was
only open for writing

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>btrfs: convert to using bdi_setup_and_register()</title>
<updated>2010-04-26T08:27:54Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2010-04-26T08:27:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e6d086d83cf7f102d48c006f58172a69ec0c15a4'/>
<id>urn:sha1:e6d086d83cf7f102d48c006f58172a69ec0c15a4</id>
<content type='text'>
It's now a provided helper, so get rid of the internal setup
and btrfs atomic_t bdi enumerator.

Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable</title>
<updated>2010-04-13T01:37:04Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2010-04-13T01:37:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d6cf853d4d73c268fc8920ac4e812ee26a12847c'/>
<id>urn:sha1:d6cf853d4d73c268fc8920ac4e812ee26a12847c</id>
<content type='text'>
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: make sure the chunk allocator doesn't create zero length chunks
  Btrfs: fix data enospc check overflow
</content>
</entry>
</feed>
