<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/super.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: cleanup orphans while looking up default subvolume</title>
<updated>2015-06-23T00:03:36Z</updated>
<author>
<name>Jeff Mahoney</name>
</author>
<published>2015-03-20T18:02:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=845f2c2fdf8a351d98e8d12371a713a785333982'/>
<id>urn:sha1:845f2c2fdf8a351d98e8d12371a713a785333982</id>
<content type='text'>
commit 727b9784b6085c99c2f836bf4fcc2848dc9cf904 upstream.

Orphans in the fs tree are cleaned up via open_ctree and subvolume
orphans are cleaned via btrfs_lookup_dentry -- except when a default
subvolume is in use.  The name for the default subvolume uses a manual
lookup that doesn't trigger orphan cleanup and needs to trigger it
manually as well. This doesn't apply to the remount case since the
subvolumes are cleaned up by walking the root radix tree.

Signed-off-by: Jeff Mahoney &lt;jeffm@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>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs</title>
<updated>2015-02-19T22:36:00Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2015-02-19T22:36:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b9fb532d4168e8974fe49709e2c4c8d5352a64c'/>
<id>urn:sha1:2b9fb532d4168e8974fe49709e2c4c8d5352a64c</id>
<content type='text'>
Pull btrfs updates from Chris Mason:
 "This pull is mostly cleanups and fixes:

   - The raid5/6 cleanups from Zhao Lei fixup some long standing warts
     in the code and add improvements on top of the scrubbing support
     from 3.19.

   - Josef has round one of our ENOSPC fixes coming from large btrfs
     clusters here at FB.

   - Dave Sterba continues a long series of cleanups (thanks Dave), and
     Filipe continues hammering on corner cases in fsync and others

  This all was held up a little trying to track down a use-after-free in
  btrfs raid5/6.  It's not clear yet if this is just made easier to
  trigger with this pull or if its a new bug from the raid5/6 cleanups.
  Dave Sterba is the only one to trigger it so far, but he has a
  consistent way to reproduce, so we'll get it nailed shortly"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (68 commits)
  Btrfs: don't remove extents and xattrs when logging new names
  Btrfs: fix fsync data loss after adding hard link to inode
  Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group
  Btrfs: account for large extents with enospc
  Btrfs: don't set and clear delalloc for O_DIRECT writes
  Btrfs: only adjust outstanding_extents when we do a short write
  btrfs: Fix out-of-space bug
  Btrfs: scrub, fix sleep in atomic context
  Btrfs: fix scheduler warning when syncing log
  Btrfs: Remove unnecessary placeholder in btrfs_err_code
  btrfs: cleanup init for list in free-space-cache
  btrfs: delete chunk allocation attemp when setting block group ro
  btrfs: clear bio reference after submit_one_bio()
  Btrfs: fix scrub race leading to use-after-free
  Btrfs: add missing cleanup on sysfs init failure
  Btrfs: fix race between transaction commit and empty block group removal
  btrfs: add more checks to btrfs_read_sys_array
  btrfs: cleanup, rename a few variables in btrfs_read_sys_array
  btrfs: add checks for sys_chunk_array sizes
  btrfs: more superblock checks, lower bounds on devices and sectorsize/nodesize
  ...
</content>
</entry>
<entry>
<title>btrfs: remove a no-op unfreeze superbock callback</title>
<updated>2015-01-22T02:02:04Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2015-01-20T18:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=730a78c741df4eaa24589015191f03c2d1240091'/>
<id>urn:sha1:730a78c741df4eaa24589015191f03c2d1240091</id>
<content type='text'>
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: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.</title>
<updated>2015-01-21T01:20:21Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2015-01-19T07:42:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a53f4f8e9c8ebe6c9ee3b34c368913aae9876e22'/>
<id>urn:sha1:a53f4f8e9c8ebe6c9ee3b34c368913aae9876e22</id>
<content type='text'>
Commit 6b5fe46dfa52 (btrfs: do commit in sync_fs if there are pending
changes) will call btrfs_start_transaction() in sync_fs(), to handle
some operations needed to be done in next transaction.

However this can cause deadlock if the filesystem is frozen, with the
following sys_r+w output:
[  143.255932] Call Trace:
[  143.255936]  [&lt;ffffffff816c0e09&gt;] schedule+0x29/0x70
[  143.255939]  [&lt;ffffffff811cb7f3&gt;] __sb_start_write+0xb3/0x100
[  143.255971]  [&lt;ffffffffa040ec06&gt;] start_transaction+0x2e6/0x5a0
[btrfs]
[  143.255992]  [&lt;ffffffffa040f1eb&gt;] btrfs_start_transaction+0x1b/0x20
[btrfs]
[  143.256003]  [&lt;ffffffffa03dc0ba&gt;] btrfs_sync_fs+0xca/0xd0 [btrfs]
[  143.256007]  [&lt;ffffffff811f7be0&gt;] sync_fs_one_sb+0x20/0x30
[  143.256011]  [&lt;ffffffff811cbd01&gt;] iterate_supers+0xe1/0xf0
[  143.256014]  [&lt;ffffffff811f7d75&gt;] sys_sync+0x55/0x90
[  143.256017]  [&lt;ffffffff816c49d2&gt;] system_call_fastpath+0x12/0x17
[  143.256111] Call Trace:
[  143.256114]  [&lt;ffffffff816c0e09&gt;] schedule+0x29/0x70
[  143.256119]  [&lt;ffffffff816c3405&gt;] rwsem_down_write_failed+0x1c5/0x2d0
[  143.256123]  [&lt;ffffffff8133f013&gt;] call_rwsem_down_write_failed+0x13/0x20
[  143.256131]  [&lt;ffffffff811caae8&gt;] thaw_super+0x28/0xc0
[  143.256135]  [&lt;ffffffff811db3e5&gt;] do_vfs_ioctl+0x3f5/0x540
[  143.256187]  [&lt;ffffffff811db5c1&gt;] SyS_ioctl+0x91/0xb0
[  143.256213]  [&lt;ffffffff816c49d2&gt;] system_call_fastpath+0x12/0x17

The reason is like the following:
(Holding s_umount)
VFS sync_fs staff:
|- btrfs_sync_fs()
   |- btrfs_start_transaction()
      |- sb_start_intwrite()
      (Waiting thaw_fs to unfreeze)
					VFS thaw_fs staff:
					thaw_fs()
					(Waiting sync_fs to release
					 s_umount)

So deadlock happens.
This can be easily triggered by fstest/generic/068 with inode_cache
mount option.

The fix is to check if the fs is frozen, if the fs is frozen, just
return and waiting for the next transaction.

Cc: David Sterba &lt;dsterba@suse.cz&gt;
Reported-by: Gui Hecheng &lt;guihc.fnst@cn.fujitsu.com&gt;
Signed-off-by: Qu Wenruo &lt;quwenruo@cn.fujitsu.com&gt;
[enhanced comment, changed to SB_FREEZE_WRITE]
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: sync ioctl, handle errors after transaction start</title>
<updated>2015-01-19T21:05:44Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2015-01-19T13:21:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98bd5c547ef2300f915fc1adce5b6f25c195d4d4'/>
<id>urn:sha1:98bd5c547ef2300f915fc1adce5b6f25c195d4d4</id>
<content type='text'>
The version merged to 3.19 did not handle errors from start_trancaction
and could pass an invalid pointer to commit_transaction.

Fixes: 6b5fe46dfa52441f ("btrfs: do commit in sync_fs if there are pending changes")
Reported-by: Filipe Manana &lt;fdmanana@suse.com&gt;
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: make btrfs_abort_transaction consider existence of new block groups</title>
<updated>2014-12-03T02:35:09Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2014-11-26T15:28:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c92f6be34c501406daf5e61f3569a1813f985393'/>
<id>urn:sha1:c92f6be34c501406daf5e61f3569a1813f985393</id>
<content type='text'>
If the transaction handle doesn't have used blocks but has created new block
groups make sure we turn the fs into readonly mode too. This is because the
new block groups didn't get all their metadata persisted into the chunk and
device trees, and therefore if a subsequent transaction starts, allocates
space from the new block groups, writes data or metadata into that space,
commits successfully and then after we unmount and mount the filesystem
again, the same space can be allocated again for a new block group,
resulting in file data or metadata corruption.

Example where we don't abort the transaction when we fail to finish the
chunk allocation (add items to the chunk and device trees) and later a
future transaction where the block group is removed fails because it can't
find the chunk item in the chunk tree:

[25230.404300] WARNING: CPU: 0 PID: 7721 at fs/btrfs/super.c:260 __btrfs_abort_transaction+0x50/0xfc [btrfs]()
[25230.404301] BTRFS: Transaction aborted (error -28)
[25230.404302] Modules linked in: btrfs dm_flakey nls_utf8 fuse xor raid6_pq ntfs vfat msdos fat xfs crc32c_generic libcrc32c ext3 jbd ext2 dm_mod nfsd auth_rpcgss oid_registry nfs_acl nfs lockd fscache sunrpc loop psmouse i2c_piix4 i2ccore parport_pc parport processor button pcspkr serio_raw thermal_sys evdev microcode ext4 crc16 jbd2 mbcache sr_mod cdrom ata_generic sg sd_mod crc_t10dif crct10dif_generic crct10dif_common virtio_scsi floppy e1000 ata_piix libata virtio_pci virtio_ring scsi_mod virtio [last unloaded: btrfs]
[25230.404325] CPU: 0 PID: 7721 Comm: xfs_io Not tainted 3.17.0-rc5-btrfs-next-1+ #1
[25230.404326] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
[25230.404328]  0000000000000000 ffff88004581bb08 ffffffff813e7a13 ffff88004581bb50
[25230.404330]  ffff88004581bb40 ffffffff810423aa ffffffffa049386a 00000000ffffffe4
[25230.404332]  ffffffffa05214c0 000000000000240c ffff88010fc8f800 ffff88004581bba8
[25230.404334] Call Trace:
[25230.404338]  [&lt;ffffffff813e7a13&gt;] dump_stack+0x45/0x56
[25230.404342]  [&lt;ffffffff810423aa&gt;] warn_slowpath_common+0x7f/0x98
[25230.404351]  [&lt;ffffffffa049386a&gt;] ? __btrfs_abort_transaction+0x50/0xfc [btrfs]
[25230.404353]  [&lt;ffffffff8104240b&gt;] warn_slowpath_fmt+0x48/0x50
[25230.404362]  [&lt;ffffffffa049386a&gt;] __btrfs_abort_transaction+0x50/0xfc [btrfs]
[25230.404374]  [&lt;ffffffffa04a8c43&gt;] btrfs_create_pending_block_groups+0x10c/0x135 [btrfs]
[25230.404387]  [&lt;ffffffffa04b77fd&gt;] __btrfs_end_transaction+0x7e/0x2de [btrfs]
[25230.404398]  [&lt;ffffffffa04b7a6d&gt;] btrfs_end_transaction+0x10/0x12 [btrfs]
[25230.404408]  [&lt;ffffffffa04a3d64&gt;] btrfs_check_data_free_space+0x111/0x1f0 [btrfs]
[25230.404421]  [&lt;ffffffffa04c53bd&gt;] __btrfs_buffered_write+0x160/0x48d [btrfs]
[25230.404425]  [&lt;ffffffff811a9268&gt;] ? cap_inode_need_killpriv+0x2d/0x37
[25230.404429]  [&lt;ffffffff810f6501&gt;] ? get_page+0x1a/0x2b
[25230.404441]  [&lt;ffffffffa04c7c95&gt;] btrfs_file_write_iter+0x321/0x42f [btrfs]
[25230.404443]  [&lt;ffffffff8110f5d9&gt;] ? handle_mm_fault+0x7f3/0x846
[25230.404446]  [&lt;ffffffff813e98c5&gt;] ? mutex_unlock+0x16/0x18
[25230.404449]  [&lt;ffffffff81138d68&gt;] new_sync_write+0x7c/0xa0
[25230.404450]  [&lt;ffffffff81139401&gt;] vfs_write+0xb0/0x112
[25230.404452]  [&lt;ffffffff81139c9d&gt;] SyS_pwrite64+0x66/0x84
[25230.404454]  [&lt;ffffffff813ebf52&gt;] system_call_fastpath+0x16/0x1b
[25230.404455] ---[ end trace 5aa5684fdf47ab38 ]---
[25230.404458] BTRFS warning (device sdc): btrfs_create_pending_block_groups:9228: Aborting unused transaction(No space left).
[25288.084814] BTRFS: error (device sdc) in btrfs_free_chunk:2509: errno=-2 No such entry (Failed lookup while freeing chunk.)

Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dev/pending-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus</title>
<updated>2014-11-25T13:45:30Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2014-11-25T13:45:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ad27c0dab76a7abc8809ec41ae59cf67de5ea906'/>
<id>urn:sha1:ad27c0dab76a7abc8809ec41ae59cf67de5ea906</id>
<content type='text'>
</content>
</entry>
<entry>
<title>btrfs: fix wrong accounting of raid1 data profile in statfs</title>
<updated>2014-11-21T01:20:09Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-11-14T14:05:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d95c1bec906dd1ad951c9c001e798ca52baeb0f'/>
<id>urn:sha1:0d95c1bec906dd1ad951c9c001e798ca52baeb0f</id>
<content type='text'>
The sizes that are obtained from space infos are in raw units and have
to be adjusted according to the raid factor. This was missing for
f_bavail and df reported doubled size for raid1.

Reported-by: Martin Steigerwald &lt;Martin@lichtvoll.de&gt;
Fixes: ba7b6e62f420 ("btrfs: adjust statfs calculations according to raid profiles")
CC: stable@vger.kernel.org
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: don't take the chunk_mutex/dev_list mutex in statfs V2</title>
<updated>2014-11-21T01:20:05Z</updated>
<author>
<name>Josef Bacik</name>
</author>
<published>2014-11-03T13:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e33fd993a74b3fda39c756803ba8b24bef72df5'/>
<id>urn:sha1:7e33fd993a74b3fda39c756803ba8b24bef72df5</id>
<content type='text'>
Our gluster boxes get several thousand statfs() calls per second, which begins
to suck hardcore with all of the lock contention on the chunk mutex and dev list
mutex.  We don't really need to hold these things, if we have transient
weirdness with statfs() because of the chunk allocator we don't care, so remove
this locking.

We still need the dev_list lock if you mount with -o alloc_start however, which
is a good argument for nuking that thing from orbit, but that's a patch for
another day.  Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>btrfs: switch inode_cache option handling to pending changes</title>
<updated>2014-11-12T15:53:13Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2014-02-05T14:26:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e1876aca815029d5c3023a66a91e249eca3e533'/>
<id>urn:sha1:7e1876aca815029d5c3023a66a91e249eca3e533</id>
<content type='text'>
The pending mount option(s) now share namespace and bits with the normal
options, and the existing one for (inode_cache) is unset unconditionally
at each transaction commit.

Introduce a separate namespace for pending changes and enhance the
descriptions of the intended change to use separate bits for each
action.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
</feed>
