<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/fs/btrfs/ctree.c, branch dev</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2015-06-03T11:03:08+00:00</updated>
<entry>
<title>Btrfs: fix up read_tree_block to return proper error</title>
<updated>2015-06-03T11:03:08+00:00</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2015-05-25T09:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=64c043de466d5746e7ca306dab9d418cd871cefc'/>
<id>urn:sha1:64c043de466d5746e7ca306dab9d418cd871cefc</id>
<content type='text'>
The return value of read_tree_block() can confuse callers as it always
returns NULL for either -ENOMEM or -EIO, so it's likely that callers
parse it to a wrong error, for instance, in btrfs_read_tree_root().

This fixes the above issue.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cleanups-post-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.1</title>
<updated>2015-03-25T17:52:48+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-03-25T17:52:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=fc4c3c872f44bf425963feba57eb9c3f8ac2d7eb'/>
<id>urn:sha1:fc4c3c872f44bf425963feba57eb9c3f8ac2d7eb</id>
<content type='text'>
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;

Conflicts:
	fs/btrfs/disk-io.c
</content>
</entry>
<entry>
<title>Merge branch 'cleanups-for-4.1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.1</title>
<updated>2015-03-25T17:43:16+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-03-25T17:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9deed229fa8a83bb5cd713b2d2a8e5c022a4b45b'/>
<id>urn:sha1:9deed229fa8a83bb5cd713b2d2a8e5c022a4b45b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>btrfs: cleanup, use kmalloc_array/kcalloc array helpers</title>
<updated>2015-03-03T16:23:58+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.cz</email>
</author>
<published>2015-02-20T17:00:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=31e818fe7375d60de9953051f7bd1615cebc3681'/>
<id>urn:sha1:31e818fe7375d60de9953051f7bd1615cebc3681</id>
<content type='text'>
Convert kmalloc(nr * size, ..) to kmalloc_array that does additional
overflow checks, the zeroing variant is kcalloc.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>Btrfs: fix off-by-one logic error in btrfs_realloc_node</title>
<updated>2015-03-02T22:04:45+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2015-02-23T19:48:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=5dfe2be7ead15863fd7b3fcc8bd69e470fae2bec'/>
<id>urn:sha1:5dfe2be7ead15863fd7b3fcc8bd69e470fae2bec</id>
<content type='text'>
The end_slot variable actually matches the number of pointers in the
node and not the last slot (which is 'nritems - 1'). Therefore in order
to check that the current slot in the for loop doesn't match the last
one, the correct logic is to check if 'i' is less than 'end_slot - 1'
and not 'end_slot - 2'.

Fix this and set end_slot to be 'nritems - 1', as it's less confusing
since the variable name implies it's inclusive rather then exclusive.

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: disk-io: replace root args iff only fs_info used</title>
<updated>2015-02-16T17:48:43+00:00</updated>
<author>
<name>Daniel Dressler</name>
<email>danieru.dressler@gmail.com</email>
</author>
<published>2014-11-21T08:15:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=01d58472a887cba61da7b4e6dc251b5170b57e2e'/>
<id>urn:sha1:01d58472a887cba61da7b4e6dc251b5170b57e2e</id>
<content type='text'>
This is the 3rd independent patch of a larger project to cleanup btrfs's
internal usage of btrfs_root. Many functions take btrfs_root only to
grab the fs_info struct.

By requiring a root these functions cause programmer overhead. That
these functions can accept any valid root is not obvious until
inspection.

This patch reduces the specificity of such functions to accept the
fs_info directly.

These patches can be applied independently and thus are not being
submitted as a patch series. There should be about 26 patches by the
project's completion. Each patch will cleanup between 1 and 34 functions
apiece.  Each patch covers a single file's functions.

This patch affects the following function(s):
  1) csum_tree_block
  2) csum_dirty_buffer
  3) check_tree_block_fsid
  4) btrfs_find_tree_block
  5) clean_tree_block

Signed-off-by: Daniel Dressler &lt;danieru.dressler@gmail.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>Btrfs: ctree: reduce args where only fs_info used</title>
<updated>2015-02-16T17:48:43+00:00</updated>
<author>
<name>Daniel Dressler</name>
<email>danieru.dressler@gmail.com</email>
</author>
<published>2014-11-12T04:43:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b7a0365ec7a0fb1d39113846fd34038af68ebd01'/>
<id>urn:sha1:b7a0365ec7a0fb1d39113846fd34038af68ebd01</id>
<content type='text'>
This patch is part of a larger project to cleanup btrfs's internal usage
of struct btrfs_root. Many functions take btrfs_root only to grab a
pointer to fs_info.

This causes programmers to ponder which root can be passed. Since only
the fs_info is read affected functions can accept any root, except this
is only obvious upon inspection.

This patch reduces the specificty of such functions to accept the
fs_info directly.

This patch does not address the two functions in ctree.c (insert_ptr,
and split_item) which only use root for BUG_ONs in ctree.c

This patch affects the following functions:
  1) fixup_low_keys
  2) btrfs_set_item_key_safe

Signed-off-by: Daniel Dressler &lt;danieru.dressler@gmail.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>Btrfs: insert_new_root: Fix lock type of the extent buffer.</title>
<updated>2015-01-22T13:42:23+00:00</updated>
<author>
<name>chandan</name>
<email>chandan@linux.vnet.ibm.com</email>
</author>
<published>2015-01-15T06:52:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=95449a1626fb6b643b576b9fbafed02793627577'/>
<id>urn:sha1:95449a1626fb6b643b576b9fbafed02793627577</id>
<content type='text'>
btrfs_alloc_tree_block() returns an extent buffer on which a blocked lock has
been taken. Hence assign the appropriate value to path-&gt;locks[level].

Signed-off-by: Chandan Rajendra &lt;chandan@linux.vnet.ibm.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: fix setup_leaf_for_split() to avoid leaf corruption</title>
<updated>2015-01-22T02:02:03+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2015-01-20T12:40:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=a8df6fe666f9a3a7c08df70f94351f967462dd95'/>
<id>urn:sha1:a8df6fe666f9a3a7c08df70f94351f967462dd95</id>
<content type='text'>
We were incorrectly detecting when the target key didn't exist anymore
after releasing the path and re-searching the tree. This could make
us split or duplicate (btrfs_split_item() and btrfs_duplicate_item()
are its only callers at the moment) an item when we should not.

For the case of duplicating an item, we currently only duplicate
checksum items (csum tree) and file extent items (fs/subvol trees).
For the checksum items we end up overriding the item completely,
but for file extent items we update only some of their fields in
the copy (done in __btrfs_drop_extents), which means we can end up
having a logical corruption for some values.

Also for the case where we duplicate a file extent item it will make
us produce a leaf with a wrong key order, as btrfs_duplicate_item()
advances us to the next slot and then its caller sets a smaller key
on the new item at that slot (like in __btrfs_drop_extents() e.g.).
Alternatively if the tree search in setup_leaf_for_split() leaves
with path-&gt;slots[0] == btrfs_header_nritems(path-&gt;nodes[0]), we end
up accessing beyond the leaf's end (when we check if the item's size
has changed) and make our caller insert an item at the invalid slot
btrfs_header_nritems(path-&gt;nodes[0]) + 1, causing an invalid memory
access if the leaf is full or nearly full.

This issue has been present since the introduction of this function
in 2009:

    Btrfs: Add btrfs_duplicate_item
    commit ad48fd754676bfae4139be1a897b1ea58f9aaf21

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/blocksize-diet-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus</title>
<updated>2015-01-22T01:49:35+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-01-22T01:49:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=57bbddd7fbf468336940d18a4c68a8678163acb0'/>
<id>urn:sha1:57bbddd7fbf468336940d18a4c68a8678163acb0</id>
<content type='text'>
</content>
</entry>
</feed>
