<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/send.c, branch linux-4.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-06-23T00:03:36Z</updated>
<entry>
<title>Btrfs: send, don't leave without decrementing clone root's send_progress</title>
<updated>2015-06-23T00:03:36Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2015-03-02T20:53:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a1e1ca1ba46fef415b663b44dae50cf1c0447f0'/>
<id>urn:sha1:3a1e1ca1ba46fef415b663b44dae50cf1c0447f0</id>
<content type='text'>
commit 2f1f465ae6da244099af55c066e5355abd8ff620 upstream.

If the clone root was not readonly or the dead flag was set on it, we were
leaving without decrementing the root's send_progress counter (and before
we just incremented it). If a concurrent snapshot deletion was in progress
and ended up being aborted, it would be impossible to later attempt to
delete again the snapshot, since the root's send_in_progress counter could
never go back to 0.

We were also setting clone_sources_to_rollback to i + 1 too early - if we
bailed out because the clone root we got is not readonly or flagged as dead
we ended up later derreferencing a null pointer because we didn't assign
the clone root to sctx-&gt;clone_roots[i].root:

		for (i = 0; sctx &amp;&amp; i &lt; clone_sources_to_rollback; i++)
			btrfs_root_dec_send_in_progress(
					sctx-&gt;clone_roots[i].root);

So just don't increment the send_in_progress counter if the root is readonly
or flagged as dead.

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-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: send, add missing check for dead clone root</title>
<updated>2015-06-23T00:03:36Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2015-03-02T20:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=146a4565fa80cb586abcda5575922d5ac71162c9'/>
<id>urn:sha1:146a4565fa80cb586abcda5575922d5ac71162c9</id>
<content type='text'>
commit 5cc2b17e80cf5770f2e585c2d90fd8af1b901258 upstream.

After we locked the root's root item, a concurrent snapshot deletion
call might have set the dead flag on it. So check if the dead flag
is set and abort if it is, just like we do for the parent root.

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-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: incremental send, don't rename a directory too soon</title>
<updated>2015-03-02T22:04:45Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2015-02-28T22:29:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84471e2429ed82fdbac0c56d5b2a18d450f99f6a'/>
<id>urn:sha1:84471e2429ed82fdbac0c56d5b2a18d450f99f6a</id>
<content type='text'>
There's one more case where we can't issue a rename operation for a
directory as soon as we process it. We used to delay directory renames
only if they have some ancestor directory with a higher inode number
that got renamed too, but there's another case where we need to delay
the rename too - when a directory A is renamed to the old name of a
directory B but that directory B has its rename delayed because it
has now (in the send root) an ancestor with a higher inode number that
was renamed. If we don't delay the directory rename in this case, the
receiving end of the send stream will attempt to rename A to the old
name of B before B got renamed to its new name, which results in a
"directory not empty" error. So fix this by delaying directory renames
for this case too.

Steps to reproduce:

  $ mkfs.btrfs -f /dev/sdb
  $ mount /dev/sdb /mnt

  $ mkdir /mnt/a
  $ mkdir /mnt/b
  $ mkdir /mnt/c
  $ touch /mnt/a/file

  $ btrfs subvolume snapshot -r /mnt /mnt/snap1

  $ mv /mnt/c /mnt/x
  $ mv /mnt/a /mnt/x/y
  $ mv /mnt/b /mnt/a

  $ btrfs subvolume snapshot -r /mnt /mnt/snap2

  $ btrfs send /mnt/snap1 -f /tmp/1.send
  $ btrfs send -p /mnt/snap1 /mnt/snap2 -f /tmp/2.send

  $ mkfs.btrfs -f /dev/sdc
  $ mount /dev/sdc /mnt2
  $ btrfs receive /mnt2 -f /tmp/1.send
  $ btrfs receive /mnt2 -f /tmp/2.send
  ERROR: rename b -&gt; a failed. Directory not empty

A test case for xfstests follows soon.

Reported-by: Ames Cornish &lt;ames@cornishes.net&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>btrfs: kill btrfs_inode_*time helpers</title>
<updated>2015-02-03T02:39:07Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-12-12T16:39:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a937b9791ec2ee71d5e303d2c02c8c1ad8abff35'/>
<id>urn:sha1:a937b9791ec2ee71d5e303d2c02c8c1ad8abff35</id>
<content type='text'>
They just opencode taking address of the timespec member.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: ensure send always works on roots without orphans</title>
<updated>2014-11-25T15:41:23Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-10-21T10:11:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e5fa8f865b3324aebd055e4054bf479cbab37e5a'/>
<id>urn:sha1:e5fa8f865b3324aebd055e4054bf479cbab37e5a</id>
<content type='text'>
Move the logic from the snapshot creation ioctl into send. This avoids
doing the transaction commit if send isn't used, and ensures that if
a crash/reboot happens after the transaction commit that created the
snapshot and before the transaction commit that switched the commit
root, send will not get a commit root that differs from the main root
(that has orphan items).

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 'cleanup/misc-for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus</title>
<updated>2014-10-04T16:56:45Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2014-10-04T16:56:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bbf65cf0b5b67843ca094df01019222b85af2183'/>
<id>urn:sha1:bbf65cf0b5b67843ca094df01019222b85af2183</id>
<content type='text'>
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;

Conflicts:
	fs/btrfs/extent_io.c
</content>
</entry>
<entry>
<title>Btrfs: send, don't delay dir move if there's a new parent inode</title>
<updated>2014-10-03T23:14:59Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-10-02T18:17:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bf8e8ca6fd4ac6e8edc58b92cffb2ffd51933138'/>
<id>urn:sha1:bf8e8ca6fd4ac6e8edc58b92cffb2ffd51933138</id>
<content type='text'>
If between two snapshots we rename an existing directory named X to Y and
make it a child (direct or not) of a new inode named X, we were delaying
the move/rename of the former directory unnecessarily, which would result
in attempting to rename the new directory from its orphan name to name X
prematurely.

Minimal reproducer:

    $ mkfs.btrfs -f /dev/vdd
    $ mount /dev/vdd /mnt
    $ mkdir -p /mnt/merlin/RC/OSD/Source

    $ btrfs subvolume snapshot -r /mnt /mnt/mysnap1

    $ mkdir /mnt/OSD
    $ mv /mnt/merlin/RC/OSD /mnt/OSD/OSD-Plane_788
    $ mv /mnt/OSD /mnt/merlin/RC

    $ btrfs subvolume snapshot -r /mnt /mnt/mysnap2

    $ btrfs send /mnt/mysnap1 -f /tmp/1.snap
    $ btrfs send -p /mnt/mysnap1 /mnt/mysnap2 -f /tmp/2.snap

    $ mkfs.btrfs -f /dev/vdc
    $ mount /dev/vdc /mnt2

    $ btrfs receive /mnt2 -f /tmp/1.snap
    $ btrfs receive /mnt2 -f /tmp/2.snap

The second receive (from an incremental send) failed with the following
error message: "rename o261-7-0 -&gt; merlin/RC/OSD failed".
This is a regression introduced in the 3.16 kernel.

A test case for xfstests follows.

Reported-by: Marc Merlin &lt;marc@merlins.org&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>btrfs: hide typecast to definition of BTRFS_SEND_TRANS_STUB</title>
<updated>2014-10-02T15:30:31Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-07-30T22:43:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2755a0de64693501741fb3603cd8ca928b0b7e81'/>
<id>urn:sha1:2755a0de64693501741fb3603cd8ca928b0b7e81</id>
<content type='text'>
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>Btrfs: send, lower mem requirements for processing xattrs</title>
<updated>2014-09-17T20:38:16Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-08-20T09:45:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4395e0c4da486f007dcb45b0336427be7ec08ab1'/>
<id>urn:sha1:4395e0c4da486f007dcb45b0336427be7ec08ab1</id>
<content type='text'>
Maximum xattr size can be up to nearly the leaf size. For an fs with a
leaf size larger than the page size, using kmalloc requires allocating
multiple pages that are contiguous, which might not be possible if
there's heavy memory fragmentation. Therefore fallback to vmalloc if
we fail to allocate with kmalloc. Also start with a smaller buffer size,
since xattr values typically are smaller than a page.

Reported-by: Chris Murphy &lt;lists@colorremedies.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>Btrfs: fix sparse warning</title>
<updated>2014-09-17T20:37:35Z</updated>
<author>
<name>Fabian Frederick</name>
</author>
<published>2014-07-15T19:17:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d447d0da44cd7d396277d1d8f46b418c721fbc02'/>
<id>urn:sha1:d447d0da44cd7d396277d1d8f46b418c721fbc02</id>
<content type='text'>
Fix the following sparse warning:
fs/btrfs/send.c:518:51: warning: incorrect type in argument 2 (different address spaces)
fs/btrfs/send.c:518:51:    expected char const [noderef] &lt;asn:1&gt;*&lt;noident&gt;
fs/btrfs/send.c:518:51:    got char *

We can safely use (const char __user *) with set_fs(KERNEL_DS)

__force added to avoid sparse-all warning:
fs/btrfs/send.c:518:40: warning: cast adds address space to expression (&lt;asn:1&gt;)

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Reviewed-by: Zach Brown &lt;zab@zabbo.net&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
</feed>
