<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/fs/btrfs/free-space-cache.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-03T02:34:34+00:00</updated>
<entry>
<title>Btrfs: fix mutex unlock without prior lock on space cache truncation</title>
<updated>2015-06-03T02:34:34+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2015-04-30T16:47:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=35c766425adc8e6cd1bdc8554fa540364f218fb7'/>
<id>urn:sha1:35c766425adc8e6cd1bdc8554fa540364f218fb7</id>
<content type='text'>
If the call to btrfs_truncate_inode_items() failed and we don't have a block
group, we were unlocking the cache_write_mutex without having locked it (we
do it only if we have a block group).

Fixes: 1bbc621ef284 ("Btrfs: allow block group cache writeout
                      outside critical section in commit")

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;
</content>
</entry>
<entry>
<title>Btrfs: fix crash after inode cache writeback failure</title>
<updated>2015-05-11T14:59:10+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2015-05-05T14:21:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e43699d4b4c5d9ecbcb5998cdcbada060981171f'/>
<id>urn:sha1:e43699d4b4c5d9ecbcb5998cdcbada060981171f</id>
<content type='text'>
If the writeback of an inode cache failed we were unnecessarilly
attempting to release again the delalloc metadata that we previously
reserved. However attempting to do this a second time triggers an
assertion at drop_outstanding_extent() because we have no more
outstanding extents for our inode cache's inode. If we were able
to start writeback of the cache the reserved metadata space is
released at btrfs_finished_ordered_io(), even if an error happens
during writeback.

So make sure we don't repeat the metadata space release if writeback
started for our inode cache.

This issue was trivial to reproduce by running the fstest btrfs/088
with "-o inode_cache", which triggered the assertion leading to a
BUG() call and requiring a reboot in order to run the remaining
fstests. Trace produced by btrfs/088:

[255289.385904] BTRFS: assertion failed: BTRFS_I(inode)-&gt;outstanding_extents &gt;= num_extents, file: fs/btrfs/extent-tree.c, line: 5276
[255289.388094] ------------[ cut here ]------------
[255289.389184] kernel BUG at fs/btrfs/ctree.h:4057!
[255289.390125] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
(...)
[255289.392068] Call Trace:
[255289.392068]  [&lt;ffffffffa035e774&gt;] drop_outstanding_extent+0x3d/0x6d [btrfs]
[255289.392068]  [&lt;ffffffffa0364988&gt;] btrfs_delalloc_release_metadata+0x54/0xe3 [btrfs]
[255289.392068]  [&lt;ffffffffa03b4174&gt;] btrfs_write_out_ino_cache+0x95/0xad [btrfs]
[255289.392068]  [&lt;ffffffffa036f5c4&gt;] btrfs_save_ino_cache+0x275/0x2dc [btrfs]
[255289.392068]  [&lt;ffffffffa03e2d83&gt;] commit_fs_roots.isra.12+0xaa/0x137 [btrfs]
[255289.392068]  [&lt;ffffffff8107d33d&gt;] ? trace_hardirqs_on+0xd/0xf
[255289.392068]  [&lt;ffffffffa037841f&gt;] ? btrfs_commit_transaction+0x4b1/0x9c9 [btrfs]
[255289.392068]  [&lt;ffffffff814351a4&gt;] ? _raw_spin_unlock+0x32/0x46
[255289.392068]  [&lt;ffffffffa037842e&gt;] btrfs_commit_transaction+0x4c0/0x9c9 [btrfs]
(...)

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 wrong mapping flags for free space inode</title>
<updated>2015-05-07T00:06:13+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2015-05-06T10:17:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=1d3c61c2eb3fe4f96d3192212f1bdcee49ea55aa'/>
<id>urn:sha1:1d3c61c2eb3fe4f96d3192212f1bdcee49ea55aa</id>
<content type='text'>
We were passing a flags value that differed from the intention in commit
2b108268006e ("Btrfs: don't use highmem for free space cache pages").

This caused problems in a ARM machine, leaving btrfs unusable there.

Reported-by: Merlijn Wajer &lt;merlijn@wizzup.org&gt;
Tested-by: Merlijn Wajer &lt;merlijn@wizzup.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: check io_ctl_prepare_pages return in __btrfs_write_out_cache</title>
<updated>2015-04-26T13:27:01+00:00</updated>
<author>
<name>Omar Sandoval</name>
<email>osandov@osandov.com</email>
</author>
<published>2015-02-24T10:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b86054540e4ad7d8df67f3a80658d037a2ce1c02'/>
<id>urn:sha1:b86054540e4ad7d8df67f3a80658d037a2ce1c02</id>
<content type='text'>
If io_ctl_prepare_pages fails, the pages in io_ctl.pages are not valid.
When we try to access them later, things will blow up in various ways.

Also fix the comment about the return value, which is an errno on error,
not -1, and update the cases where it was not.

Reviewed-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: Omar Sandoval &lt;osandov@osandov.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: prevent list corruption during free space cache processing</title>
<updated>2015-04-24T18:52:25+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-04-24T18:00:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=a3bdccc4e683f0ac69230707ed3fa20e7cf73a79'/>
<id>urn:sha1:a3bdccc4e683f0ac69230707ed3fa20e7cf73a79</id>
<content type='text'>
__btrfs_write_out_cache is holding the ctl-&gt;tree_lock while it prepares
a list of bitmaps to record in the free space cache.  It was dropping
the lock while it worked on other components, which made a window for
free_bitmap() to free the bitmap struct without removing it from the
list.

This changes things to hold the lock the whole time, and also makes sure
we hold the lock during enospc cleanup.

Reported-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: fix inode cache writeout</title>
<updated>2015-04-24T00:47:34+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-04-23T15:02:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=85db36cfb3de1422aeafb4e2ce83396333b744bb'/>
<id>urn:sha1:85db36cfb3de1422aeafb4e2ce83396333b744bb</id>
<content type='text'>
The code to fix stalls during free spache cache IO wasn't using
the correct root when waiting on the IO for inode caches.  This
is only a problem when the inode cache is enabled with

mount -o inode_cache

This fixes the inode cache writeout to preserve any error values and
makes sure not to override the root when inode cache writeout is done.

Reported-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: allow block group cache writeout outside critical section in commit</title>
<updated>2015-04-10T21:07:22+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-04-06T19:46:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=1bbc621ef28462456131c035eaeb5567a1a2a2fe'/>
<id>urn:sha1:1bbc621ef28462456131c035eaeb5567a1a2a2fe</id>
<content type='text'>
We loop through all of the dirty block groups during commit and write
the free space cache.  In order to make sure the cache is currect, we do
this while no other writers are allowed in the commit.

If a large number of block groups are dirty, this can introduce long
stalls during the final stages of the commit, which can block new procs
trying to change the filesystem.

This commit changes the block group cache writeout to take appropriate
locks and allow it to run earlier in the commit.  We'll still have to
redo some of the block groups, but it means we can get most of the work
out of the way without blocking the entire FS.

Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: don't use highmem for free space cache pages</title>
<updated>2015-04-10T21:07:18+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-04-06T14:48:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=2b108268006e06d57ec9810f4ccf5d99d7e5b598'/>
<id>urn:sha1:2b108268006e06d57ec9810f4ccf5d99d7e5b598</id>
<content type='text'>
In order to create the free space cache concurrently with FS modifications,
we need to take a few block group locks.

The cache code also does kmap, which would schedule with the locks held.
Instead of going through kmap_atomic, lets just use lowmem for the cache
pages.

Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: two stage dirty block group writeout</title>
<updated>2015-04-10T21:07:11+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-04-05T00:14:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c9dc4c6578502c2085705347375b82089aad18d0'/>
<id>urn:sha1:c9dc4c6578502c2085705347375b82089aad18d0</id>
<content type='text'>
Block group cache writeout is currently waiting on the pages for each
block group cache before moving on to writing the next one.  This commit
switches things around to send down all the caches and then wait on them
in batches.

The end result is much faster, since we're keeping the disk pipeline
full.

Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: move struct io_ctl into ctree.h and rename it</title>
<updated>2015-04-10T21:07:04+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@fb.com</email>
</author>
<published>2015-04-06T20:17:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=4c6d1d85ad89fd8e32dc9204b7f944854399bda9'/>
<id>urn:sha1:4c6d1d85ad89fd8e32dc9204b7f944854399bda9</id>
<content type='text'>
We'll need to put the io_ctl into the block_group cache struct, so
name it struct btrfs_io_ctl and move it into ctree.h

Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
</feed>
