<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs/btrfs/backref.c, branch linux-3.4.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>Btrfs: use right type to get real comparison</title>
<updated>2014-07-01T03:01:33+00:00</updated>
<author>
<name>Liu Bo</name>
<email>bo.li.liu@oracle.com</email>
</author>
<published>2014-06-08T11:04:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=64b84ef0258d03d80d2581b7f44b7630e945e612'/>
<id>64b84ef0258d03d80d2581b7f44b7630e945e612</id>
<content type='text'>
commit cd857dd6bc2ae9ecea14e75a34e8a8fdc158e307 upstream.

We want to make sure the point is still within the extent item, not to verify
the memory it's pointing to.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit cd857dd6bc2ae9ecea14e75a34e8a8fdc158e307 upstream.

We want to make sure the point is still within the extent item, not to verify
the memory it's pointing to.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: add missing read locks in backref.c</title>
<updated>2012-04-18T17:22:23+00:00</updated>
<author>
<name>Jan Schmidt</name>
<email>list.btrfs@jan-o-sch.net</email>
</author>
<published>2012-04-13T10:28:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b916a59adfdc875381b68ced258694b434cf43ae'/>
<id>b916a59adfdc875381b68ced258694b434cf43ae</id>
<content type='text'>
iref_to_path and iterate_irefs both increment the eb's refcount to use it
after releasing the path. Both depend on consistent data remaining in the
extent buffer and need a read lock to protect it.

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
iref_to_path and iterate_irefs both increment the eb's refcount to use it
after releasing the path. Both depend on consistent data remaining in the
extent buffer and need a read lock to protect it.

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: don't call free_extent_buffer twice in iterate_irefs</title>
<updated>2012-04-18T17:22:21+00:00</updated>
<author>
<name>Jan Schmidt</name>
<email>list.btrfs@jan-o-sch.net</email>
</author>
<published>2012-04-13T10:28:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=aefc1eb13ebbb86c5ffade8a9e2425cd71032d7e'/>
<id>aefc1eb13ebbb86c5ffade8a9e2425cd71032d7e</id>
<content type='text'>
Avoid calling free_extent_buffer more than once when the iterator function
returns non-zero. The only code that uses this is scrub repair for corrupted
nodatasum blocks.

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid calling free_extent_buffer more than once when the iterator function
returns non-zero. The only code that uses this is scrub repair for corrupted
nodatasum blocks.

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: Make free_ipath() deal gracefully with NULL pointers</title>
<updated>2012-04-18T17:22:20+00:00</updated>
<author>
<name>Jesper Juhl</name>
<email>jj@chaosbits.net</email>
</author>
<published>2012-04-12T20:47:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4735fb282830c0966b301dabcccf4753fa6604bb'/>
<id>4735fb282830c0966b301dabcccf4753fa6604bb</id>
<content type='text'>
Make free_ipath() behave like most other freeing functions in the
kernel and gracefully do nothing when passed a NULL pointer.

Besides this making the bahaviour consistent with functions such as
kfree(), vfree(), btrfs_free_path() etc etc, it also fixes a real NULL
deref issue in fs/btrfs/ioctl.c::btrfs_ioctl_ino_to_path(). In that
function we have this code:

...
        ipath = init_ipath(size, root, path);
        if (IS_ERR(ipath)) {
                ret = PTR_ERR(ipath);
                ipath = NULL;
                goto out;
        }
...
out:
        btrfs_free_path(path);
        free_ipath(ipath);
...

If we ever take the true branch of that 'if' statement we'll end up
passing a NULL pointer to free_ipath() which will subsequently
dereference it and we'll go "Boom" :-(
This patch will avoid that.

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make free_ipath() behave like most other freeing functions in the
kernel and gracefully do nothing when passed a NULL pointer.

Besides this making the bahaviour consistent with functions such as
kfree(), vfree(), btrfs_free_path() etc etc, it also fixes a real NULL
deref issue in fs/btrfs/ioctl.c::btrfs_ioctl_ino_to_path(). In that
function we have this code:

...
        ipath = init_ipath(size, root, path);
        if (IS_ERR(ipath)) {
                ret = PTR_ERR(ipath);
                ipath = NULL;
                goto out;
        }
...
out:
        btrfs_free_path(path);
        free_ipath(ipath);
...

If we ever take the true branch of that 'if' statement we'll end up
passing a NULL pointer to free_ipath() which will subsequently
dereference it and we'll go "Boom" :-(
This patch will avoid that.

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.jan-o-sch.net/btrfs-unstable into for-linus</title>
<updated>2012-03-29T00:33:40+00:00</updated>
<author>
<name>Chris Mason</name>
<email>chris.mason@oracle.com</email>
</author>
<published>2012-03-29T00:33:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=98961a7e431735c791dbaaf0337029e219a5db5a'/>
<id>98961a7e431735c791dbaaf0337029e219a5db5a</id>
<content type='text'>
Conflicts:
	fs/btrfs/transaction.c

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	fs/btrfs/transaction.c

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix memory leak in resolver code</title>
<updated>2012-03-27T14:09:18+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2012-03-27T14:09:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5eb56d2520fe16f00756ccdf8eebc277398e0f44'/>
<id>5eb56d2520fe16f00756ccdf8eebc277398e0f44</id>
<content type='text'>
init_ipath() allocates btrfs_data_container which is never freed.  Free
it in free_ipath() and nuke the comment for init_data_container() - we
can safely free it with kfree().

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
init_ipath() allocates btrfs_data_container which is never freed.  Free
it in free_ipath() and nuke the comment for init_data_container() - we
can safely free it with kfree().

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix regression in scrub path resolving</title>
<updated>2012-03-27T12:51:21+00:00</updated>
<author>
<name>Jan Schmidt</name>
<email>list.btrfs@jan-o-sch.net</email>
</author>
<published>2012-03-23T16:32:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7a3ae2f8c8c8432e65467b7fc84d5deab04061a0'/>
<id>7a3ae2f8c8c8432e65467b7fc84d5deab04061a0</id>
<content type='text'>
In commit 4692cf58 we introduced new backref walking code for btrfs. This
assumes we're searching live roots, which requires a transaction context.
While scrubbing, however, we must not join a transaction because this could
deadlock with the commit path. Additionally, what scrub really wants to do
is resolving a logical address in the commit root it's currently checking.

This patch adds support for logical to path resolving on commit roots and
makes scrub use that.

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In commit 4692cf58 we introduced new backref walking code for btrfs. This
assumes we're searching live roots, which requires a transaction context.
While scrubbing, however, we must not join a transaction because this could
deadlock with the commit path. Additionally, what scrub really wants to do
is resolving a logical address in the commit root it's currently checking.

This patch adds support for logical to path resolving on commit roots and
makes scrub use that.

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>btrfs: fix locking issues in find_parent_nodes()</title>
<updated>2012-03-03T12:41:15+00:00</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2012-03-03T12:41:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d3b010640e5c59b98d3b11229ba4cc2838dc7cbf'/>
<id>d3b010640e5c59b98d3b11229ba4cc2838dc7cbf</id>
<content type='text'>
- We might unlock head-&gt;mutex while it was not locked
- We might leave the function without unlocking delayed_refs-&gt;lock

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- We might unlock head-&gt;mutex while it was not locked
- We might leave the function without unlocking delayed_refs-&gt;lock

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: avoid positive number with ERR_PTR</title>
<updated>2012-02-15T15:40:23+00:00</updated>
<author>
<name>Jan Schmidt</name>
<email>list.btrfs@jan-o-sch.net</email>
</author>
<published>2012-02-08T15:01:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8f24b49688281a77e8331894ed407f0cfe732303'/>
<id>8f24b49688281a77e8331894ed407f0cfe732303</id>
<content type='text'>
inode_ref_info() returns 1 when the element wasn't found and &lt; 0 on error,
just like btrfs_search_slot(). In iref_to_path() it's an error when the
inode ref can't be found, thus we return ERR_PTR(ret) in that case. In order
to avoid ERR_PTR(1), we now set ret to -ENOENT in that case.

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
inode_ref_info() returns 1 when the element wasn't found and &lt; 0 on error,
just like btrfs_search_slot(). In iref_to_path() it's an error when the
inode ref can't be found, thus we return ERR_PTR(ret) in that case. In order
to avoid ERR_PTR(1), we now set ret to -ENOENT in that case.

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Btrfs: fix uninit warning in backref.c</title>
<updated>2012-01-26T20:01:11+00:00</updated>
<author>
<name>Jan Schmidt</name>
<email>list.btrfs@jan-o-sch.net</email>
</author>
<published>2012-01-26T20:01:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b1375d64c539c5b76794be759b62d3f178e67c32'/>
<id>b1375d64c539c5b76794be759b62d3f178e67c32</id>
<content type='text'>
Added initialization with the declaration of ret. It isn't set later on the
switch-default branch (which should never be taken).

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added initialization with the declaration of ret. It isn't set later on the
switch-default branch (which should never be taken).

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
