<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/ioctl.c, branch linux-3.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-10-30T16:43:05Z</updated>
<entry>
<title>Revert "Btrfs: race free update of commit root for ro snapshots"</title>
<updated>2014-10-30T16:43:05Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2014-10-15T20:50:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0bd77290116d6bbbeaf173037eddbeea44c66ea1'/>
<id>urn:sha1:0bd77290116d6bbbeaf173037eddbeea44c66ea1</id>
<content type='text'>
commit d37973082b453ba6b89ec07eb7b84305895d35e1 upstream.

This reverts commit 9c3b306e1c9e6be4be09e99a8fe2227d1005effc.

Switching only one commit root during a transaction is wrong because it
leads the fs into an inconsistent state. All commit roots should be
switched at once, at transaction commit time, otherwise backref walking
can often miss important references that were only accessible through
the old commit root.  Plus, the root item for the snapshot's root wasn't
getting updated and preventing the next transaction commit to do it.

This made several users get into random corruption issues after creation
of readonly snapshots.

A regression test for xfstests will follow soon.

Cc: stable@vger.kernel.org # 3.17
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: add missing compression property remove in btrfs_ioctl_setflags</title>
<updated>2014-10-30T16:43:04Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-09-11T10:44:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b5528ba94b362bd61485ebddbc60744f9640dea'/>
<id>urn:sha1:2b5528ba94b362bd61485ebddbc60744f9640dea</id>
<content type='text'>
commit 78a017a2c92df9b571db0a55a016280f9019c65e upstream.

The behaviour of a 'chattr -c' consists of getting the current flags,
clearing the FS_COMPR_FL bit and then sending the result to the set
flags ioctl - this means the bit FS_NOCOMP_FL isn't set in the flags
passed to the ioctl. This results in the compression property not being
cleared from the inode - it was cleared only if the bit FS_NOCOMP_FL
was set in the received flags.

Reproducer:

    $ mkfs.btrfs -f /dev/sdd
    $ mount /dev/sdd /mnt &amp;&amp; cd /mnt
    $ mkdir a
    $ chattr +c a
    $ touch a/file
    $ lsattr a/file
    --------c------- a/file
    $ chattr -c a
    $ touch a/file2
    $ lsattr a/file2
    --------c------- a/file2
    $ lsattr -d a
    ---------------- a

Reported-by: Andreas Schneider &lt;asn@cryptomilk.org&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>btrfs: wake up transaction thread from SYNC_FS ioctl</title>
<updated>2014-10-30T16:43:04Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-07-23T12:39:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e207143d7e06270fb224ad4a8e3e07cd333faa26'/>
<id>urn:sha1:e207143d7e06270fb224ad4a8e3e07cd333faa26</id>
<content type='text'>
commit 2fad4e83e12591eb3bd213875b9edc2d18e93383 upstream.

The transaction thread may want to do more work, namely it pokes the
cleaner ktread that will start processing uncleaned subvols.

This can be triggered by user via the 'btrfs fi sync' command, otherwise
there was a delay up to 30 seconds before the cleaner started to clean
old snapshots.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Btrfs: kfree()ing ERR_PTRs</title>
<updated>2014-09-08T20:56:42Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2014-09-04T11:09:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c47ca32d3aadb234f73389a34c97574085bc9eda'/>
<id>urn:sha1:c47ca32d3aadb234f73389a34c97574085bc9eda</id>
<content type='text'>
The "inherit" in btrfs_ioctl_snap_create_v2() and "vol_args" in
btrfs_ioctl_rm_dev() are ERR_PTRs so we can't call kfree() on them.

These kind of bugs are "One Err Bugs" where there is just one error
label that does everything.  I could set the "inherit = NULL" and keep
the single out label but it ends up being more complicated that way.  It
makes the code simpler to re-order the unwind so it's in the mirror
order of the allocation and introduce some new error labels.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: fix autodefrag with compression</title>
<updated>2014-08-27T15:45:37Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2014-08-26T20:55:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9512d72e8e61c750c90efacd720abe3c4569822'/>
<id>urn:sha1:e9512d72e8e61c750c90efacd720abe3c4569822</id>
<content type='text'>
The autodefrag code skips defrag when two extents are adjacent.  But one
big advantage for autodefrag is cutting down on the number of small
extents, even when they are adjacent.  This commit changes it to defrag
all small extents.

Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: clone, don't create invalid hole extent map</title>
<updated>2014-08-21T14:55:26Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-08-08T01:47:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=62e2390e1ad78f956e96a6a831761adc6f2bf58a'/>
<id>urn:sha1:62e2390e1ad78f956e96a6a831761adc6f2bf58a</id>
<content type='text'>
When cloning a file that consists of an inline extent, we were creating
an extent map that represents a non-existing trailing hole starting at a
file offset that isn't a multiple of the sector size. This happened because
when processing an inline extent we weren't aligning the extent's length to
the sector size, and therefore incorrectly treating the range
[inline_extent_length; sector_size[ as a hole.

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: Satoru Takeuchi &lt;takeuchi_satoru@jp.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: race free update of commit root for ro snapshots</title>
<updated>2014-08-21T14:55:21Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-07-31T13:41:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c3b306e1c9e6be4be09e99a8fe2227d1005effc'/>
<id>urn:sha1:9c3b306e1c9e6be4be09e99a8fe2227d1005effc</id>
<content type='text'>
This is a better solution for the problem addressed in the following
commit:

    Btrfs: update commit root on snapshot creation after orphan cleanup
    (3821f348889e506efbd268cc8149e0ebfa47c4e5)

The previous solution wasn't the best because of 2 reasons:

    1) It added another full transaction commit, which is more expensive
       than just swapping the commit root with the root;

    2) If a reboot happened after the first transaction commit (the one
       that creates the snapshot) and before the second transaction commit,
       then we would end up with the same problem if a send using that
       snapshot was requested before the first transaction commit after
       the reboot.

This change addresses those 2 issues. The second issue is addressed by
switching the commit root in the dentry lookup VFS callback, which is
also called by the snapshot/subvol creation ioctl and performs orphan
cleanup if needed. Like the vfs, the ioctl locks the parent inode too,
preventing race issues between a dentry lookup and snapshot creation.

Cc: Alex Lyakas &lt;alex.btrfs@zadarastorage.com&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs</title>
<updated>2014-07-04T15:53:53Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2014-07-04T15:53:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b82207b8e8bffae5b2df8c054a35b0994cbb9896'/>
<id>urn:sha1:b82207b8e8bffae5b2df8c054a35b0994cbb9896</id>
<content type='text'>
Pull btrfs fixes from Chris Mason:
 "We've queued up a few fixes in my for-linus branch"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: fix crash when starting transaction
  Btrfs: fix btrfs_print_leaf for skinny metadata
  Btrfs: fix race of using total_bytes_pinned
  btrfs: use E2BIG instead of EIO if compression does not help
  btrfs: remove stale comment from btrfs_flush_all_pending_stuffs
  Btrfs: fix use-after-free when cloning a trailing file hole
  btrfs: fix null pointer dereference in btrfs_show_devname when name is null
  btrfs: fix null pointer dereference in clone_fs_devices when name is null
  btrfs: fix nossd and ssd_spread mount option regression
  Btrfs: fix race between balance recovery and root deletion
  Btrfs: atomically set inode-&gt;i_flags in btrfs_update_iflags
  btrfs: only unlock block in verify_parent_transid if we locked it
  Btrfs: assert send doesn't attempt to start transactions
  btrfs compression: reuse recently used workspace
  Btrfs: fix crash when mounting raid5 btrfs with missing disks
  btrfs: create sprout should rename fsid on the sysfs as well
  btrfs: dev replace should replace the sysfs entry
  btrfs: dev add should add its sysfs entry
  btrfs: dev delete should remove sysfs entry
  btrfs: rename add_device_membership to btrfs_kobj_add_device
</content>
</entry>
<entry>
<title>Btrfs: fix use-after-free when cloning a trailing file hole</title>
<updated>2014-07-03T14:04:10Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-06-29T20:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14f5979633a67de81b9bd4a36a0eb99125728f9b'/>
<id>urn:sha1:14f5979633a67de81b9bd4a36a0eb99125728f9b</id>
<content type='text'>
The transaction handle was being used after being freed.

Cc: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Filipe David Borba Manana &lt;fdmanana@gmail.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: atomically set inode-&gt;i_flags in btrfs_update_iflags</title>
<updated>2014-07-03T14:03:23Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-06-25T21:36:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3cc79392558f1789e5e1d2fce44b681980f403c3'/>
<id>urn:sha1:3cc79392558f1789e5e1d2fce44b681980f403c3</id>
<content type='text'>
This change is based on the corresponding recent change for ext4:

  ext4: atomically set inode-&gt;i_flags in ext4_set_inode_flags()

That has the following commit message that applies to btrfs as well:

  "Use cmpxchg() to atomically set i_flags instead of clearing out the
   S_IMMUTABLE, S_APPEND, etc. flags and then setting them from the
   EXT4_IMMUTABLE_FL, EXT4_APPEND_FL flags, since this opens up a race
   where an immutable file has the immutable flag cleared for a brief
   window of time."

Replacing EXT4_IMMUTABLE_FL and EXT4_APPEND_FL with BTRFS_INODE_IMMUTABLE
and BTRFS_INODE_APPEND, respectively.

Reviewed-by: David Sterba &lt;dsterba@suse.cz&gt;
Reviewed-by: Satoru Takeuchi &lt;takeuchi_satoru@jp.fujitsu.com&gt;
Signed-off-by: Filipe David Borba Manana &lt;fdmanana@gmail.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
</feed>
