Re: [GIT PULL] Btrfs updates for 4.18

2018-06-29 Thread Anand Jain




On 06/29/2018 02:26 AM, David Sterba wrote:

On Thu, Jun 28, 2018 at 07:22:59PM +0800, Anand Jain wrote:

   The circular locking dependency warning occurs at FSSTRESS_PROG.
   And in particular at doproc() in xfstests/ltp/fsstress.c, randomly
   at any of the command at
   opdesc_tops[] = { ..}
   which involves calling mmap file operation and if there is something
   to commit.

   The commit transaction does need device_list_mutex which is also being
   used for the btrfs_open_devices() in the commit 542c5908abfe84f7.

   But btrfs_open_devices() is only called at mount, and mmap() can
   establish only be established after the mount has completed. With
   this give its unclear to me why the circular locking dependency check
   is warning about this.

   I feel until we have clarity about this and also solve other problem
   related to the streamlining of uuid_mutex, I suggest we revert
   542c5908abfe84f7. Sorry for the inconvenience.


Ok, the revert is one option. I'm cosidering adding both the locks, like
is in https://patchwork.kernel.org/patch/10478443/ . This would have no
effect, as btrfs_open_devices is called only from mount path and the
list_sort is done only for the first time when there are not other
users of the list that would not also be under the uuid_mutex.



This passed the syzbot and other tests, so this does not break things
and goes towards pushing the device_list_mutex as the real protection
mechanism for the fs_devices members.



Let me know what you think, the revert should be the last option if we
don't have anything better.


 With this patch [1] as well I find the circular lock warning[2].
 [1]
  https://patchwork.kernel.org/patch/10478443/
 Test case:

  mkfs.btrfs -fq /dev/sdc && mount /dev/sdc /btrfs && 
/xfstests/ltp/fsstress -d /btrfs -w -p 1 -n 2000


 However when the device_list_mutex is removed, the warning goes away.
 Let me investigate bit more about circular locking dependency.

About using uuid_mutex in btrfs_open_devices().
 I am planning to be more conceivable about the using the
 bit map for the volume flags and which shall also include the
 EXCL OPS in progress flag for the fs_devices. Which means we hold
 uuid_mutex and set/reset EXCL OPS flag for the fs_devices. And so
 the other fsids like fsid2 can still hold the uuid_mutex while
 fsid1 is still mounting/opening (which may sleep).
 I hope you would agree to use bit map for volume, we also need this
 bit map to manage the volume status. Or if there is a better solution
 I am fine. However uuid_mutex isn't as it blocks fsids2 to mount.

Thanks, Anand

[2]
---
 kernel:
 kernel: ==
 kernel: WARNING: possible circular locking dependency detected
 kernel: 4.18.0-rc1+ #63 Not tainted
 kernel: --
 kernel: fsstress/3062 is trying to acquire lock:
 kernel: 7d28aeca (_info->reloc_mutex){+.+.}, at: 
btrfs_record_root_in_trans+0x43/0x70 [btrfs]

 kernel:
  but task is already holding lock:
 kernel: 2fc78565 (>mmap_sem){}, at: 
vm_mmap_pgoff+0x9f/0x110

 kernel:
  which lock already depends on the new lock.
 kernel:
  the existing dependency chain (in reverse 
order) is:

 kernel:
  -> #5 (>mmap_sem){}:
 kernel:_copy_from_user+0x1e/0x90
 kernel:scsi_cmd_ioctl+0x2ba/0x480
 kernel:cdrom_ioctl+0x3b/0xb2e
 kernel:sr_block_ioctl+0x7e/0xc0
 kernel:blkdev_ioctl+0x4ea/0x980
 kernel:block_ioctl+0x39/0x40
 kernel:do_vfs_ioctl+0xa2/0x6c0
 kernel:ksys_ioctl+0x70/0x80
 kernel:__x64_sys_ioctl+0x16/0x20
 kernel:do_syscall_64+0x4a/0x180
 kernel:entry_SYSCALL_64_after_hwframe+0x49/0xbe
 kernel:
  -> #4 (sr_mutex){+.+.}:
 kernel:sr_block_open+0x24/0xd0
 kernel:__blkdev_get+0xcb/0x480
 kernel:blkdev_get+0x144/0x3a0
 kernel:do_dentry_open+0x1b1/0x2d0
 kernel:path_openat+0x57b/0xcc0
 kernel:do_filp_open+0x9b/0x110
 kernel:do_sys_open+0x1bd/0x250
 kernel:do_syscall_64+0x4a/0x180
 kernel:entry_SYSCALL_64_after_hwframe+0x49/0xbe
 kernel:
  -> #3 (>bd_mutex){+.+.}:
 kernel:__blkdev_get+0x5d/0x480
 kernel:blkdev_get+0x243/0x3a0
 kernel:blkdev_get_by_path+0x4a/0x80
 kernel:btrfs_get_bdev_and_sb+0x1b/0xa0 [btrfs]
 kernel:open_fs_devices+0x85/0x270 [btrfs]
 kernel:btrfs_open_devices+0x6b/0x70 [btrfs]
 kernel:btrfs_mount_root+0x41a/0x7e0 [btrfs]
 kernel:mount_fs+0x30/0x150
 kernel:vfs_kern_mount.part.31+0x54/0x140
 kernel:btrfs_mount+0x175/0x920 [btrfs]
 kernel:mount_fs+0x30/0x150
 kernel:vfs_kern_mount.part.31+0x54/0x140
 

Re: [GIT PULL] Btrfs updates for 4.18

2018-06-28 Thread David Sterba
On Thu, Jun 28, 2018 at 07:22:59PM +0800, Anand Jain wrote:
>   The circular locking dependency warning occurs at FSSTRESS_PROG.
>   And in particular at doproc() in xfstests/ltp/fsstress.c, randomly
>   at any of the command at
>   opdesc_tops[] = { ..}
>   which involves calling mmap file operation and if there is something
>   to commit.
> 
>   The commit transaction does need device_list_mutex which is also being
>   used for the btrfs_open_devices() in the commit 542c5908abfe84f7.
> 
>   But btrfs_open_devices() is only called at mount, and mmap() can
>   establish only be established after the mount has completed. With
>   this give its unclear to me why the circular locking dependency check
>   is warning about this.
> 
>   I feel until we have clarity about this and also solve other problem
>   related to the streamlining of uuid_mutex, I suggest we revert
>   542c5908abfe84f7. Sorry for the inconvenience.

Ok, the revert is one option. I'm cosidering adding both the locks, like
is in https://patchwork.kernel.org/patch/10478443/ . This would have no
effect, as btrfs_open_devices is called only from mount path and the
list_sort is done only for the first time when there are not other
users of the list that would not also be under the uuid_mutex.

This passed the syzbot and other tests, so this does not break things
and goes towards pushing the device_list_mutex as the real protection
mechanism for the fs_devices members.

Let me know what you think, the revert should be the last option if we
don't have anything better.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs updates for 4.18

2018-06-28 Thread Anand Jain




On 06/12/2018 12:16 AM, David Sterba wrote:

On Mon, Jun 11, 2018 at 10:50:54AM +0100, Filipe Manana wrote:

btrfs: replace uuid_mutex by device_list_mutex in
btrfs_open_devices



   *
   * the mutex can be very coarse and can cover long-running operations
   *
   * protects: updates to fs_devices counters like missing devices, rw
devices,
   * seeding, structure cloning, openning/closing devices at mount/umount
time

generates some confusion since btrfs_open_devices(), after that
commit, no longer takes the uuid_mutex and it
updates some fs_devices counters (opened, open_devices, etc).


  As uuid_mutex is a global fs_uuids lock for the per fsid operations
  doesn't make any sense.

  This problem is reproducible only for-4.18, misc-next if fine.
  I am looking deeper.


What about the unprotected updates (increments) to fs_devices->opened
and fs_devices->open_devices?
Other functions are accessing/updating them while holding the uuid mutex.


The goal is to reduce usage of uuid_mutex only to protect search or
update of the fs_uuids list, everything else should be protected by the
device_list_mutex.

The commit 542c5908abfe84f7 (use device_list_mutex in
btrfs_open_devices) implements that but then the access to the ->opened
member is not protected consistently. There are patches that convert the
use to device_list_mutex but haven't been merged due to refinements or
pending review.

At this point I think we should revert the one commit 542c5908abfe84f7
as it introduces the locking problems and revisit the whole fs_devices
locking scheme again in the dex dev cycle. That will be post rc1 as
there might be more to revert.




 I tried to narrow this, it appears some of the things that
 circular locking dependency check report doesn't make sense.
 Here below is what I find.. as of now.

 The test case btrfs/004 can be simplified to.. which also
 reproduces the problem.

-8<-
$ cat 165
#! /bin/bash
# FS QA Test No. btrfs/165
#

seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"

here=`pwd`
tmp=/tmp/$$
status=1
noise_pid=0

_cleanup()
{
wait
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15

# get standard environment, filters and checks
. ./common/rc
. ./common/filter

# real QA test starts here
_supported_fs btrfs
_supported_os Linux
_require_scratch

rm -f $seqres.full

run_check _scratch_mkfs_sized $((2000 * 1024 * 1024))
run_check _scratch_mount
run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 1 -n 2000 $FSSTRESS_AVOID
run_check _scratch_unmount

echo "done"
status=0
exit
-8<-

 The circular locking dependency warning occurs at FSSTRESS_PROG.
 And in particular at doproc() in xfstests/ltp/fsstress.c, randomly
 at any of the command at
 opdesc_tops[] = { ..}
 which involves calling mmap file operation and if there is something
 to commit.

 The commit transaction does need device_list_mutex which is also being
 used for the btrfs_open_devices() in the commit 542c5908abfe84f7.

 But btrfs_open_devices() is only called at mount, and mmap() can
 establish only be established after the mount has completed. With
 this give its unclear to me why the circular locking dependency check
 is warning about this.

 I feel until we have clarity about this and also solve other problem
 related to the streamlining of uuid_mutex, I suggest we revert
 542c5908abfe84f7. Sorry for the inconvenience.

Thanks, Anand


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs updates for 4.18

2018-06-11 Thread David Sterba
On Mon, Jun 11, 2018 at 10:50:54AM +0100, Filipe Manana wrote:
> >>>btrfs: replace uuid_mutex by device_list_mutex in
> >>> btrfs_open_devices

> >>   *
> >>   * the mutex can be very coarse and can cover long-running operations
> >>   *
> >>   * protects: updates to fs_devices counters like missing devices, rw
> >> devices,
> >>   * seeding, structure cloning, openning/closing devices at mount/umount
> >> time
> >>
> >> generates some confusion since btrfs_open_devices(), after that
> >> commit, no longer takes the uuid_mutex and it
> >> updates some fs_devices counters (opened, open_devices, etc).
> >
> >  As uuid_mutex is a global fs_uuids lock for the per fsid operations
> >  doesn't make any sense.
> >
> >  This problem is reproducible only for-4.18, misc-next if fine.
> >  I am looking deeper.
> 
> What about the unprotected updates (increments) to fs_devices->opened
> and fs_devices->open_devices?
> Other functions are accessing/updating them while holding the uuid mutex.

The goal is to reduce usage of uuid_mutex only to protect search or
update of the fs_uuids list, everything else should be protected by the
device_list_mutex.

The commit 542c5908abfe84f7 (use device_list_mutex in
btrfs_open_devices) implements that but then the access to the ->opened
member is not protected consistently. There are patches that convert the
use to device_list_mutex but haven't been merged due to refinements or
pending review.

At this point I think we should revert the one commit 542c5908abfe84f7
as it introduces the locking problems and revisit the whole fs_devices
locking scheme again in the dex dev cycle. That will be post rc1 as
there might be more to revert.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs updates for 4.18

2018-06-11 Thread Filipe Manana
On Mon, Jun 11, 2018 at 9:14 AM, Anand Jain  wrote:
>
>
> On 06/10/2018 12:21 AM, Filipe Manana wrote:
>>
>> On Mon, Jun 4, 2018 at 4:43 PM, David Sterba  wrote:
>>>
>>> Hi,
>>>
>>> there are some new features and a usual load of cleanups, more details
>>> below.
>>>
>>> Specifically, there's a set of new non-privileged ioctls to allow
>>> subvolume listing.  It works but still needs a security review as it's a
>>> new interface and we might need to do some tweaks to the data
>>> structures. The fixes could be considred regressions but may touch the
>>> interfaces too.
>>>
>>> Currently there are no merge conflicts but linux-next has reported a few
>>> in the past, originating from other *FS trees.
>>>
>>> Please pull, thanks.
>>>
>>> ---
>>>
>>> User visible features:
>>>
>>> - added support for the ioctl FS_IOC_FSGETXATTR, per-inode flags,
>>> successor
>>>of GET/SETFLAGS; now supports only existing flags: append, immutable,
>>>noatime, nodump, sync
>>>
>>> - 3 new unprivileged ioctls to allow users to enumerate subvolumes
>>>
>>> - dedupe syscall implementation does not restrict the range to 16MiB,
>>> though it
>>>still splits the whole range to 16MiB chunks
>>>
>>> - on user demand, rmdir() is able to delete an empty subvolume, export
>>> the
>>>capability in sysfs
>>>
>>> - fix inode number types in tracepoints, other cleanups
>>>
>>> - send: improved speed when dealing with a large removed directory,
>>>measurements show decrease from 2000 minutes to 2 minutes on a
>>> directory with
>>>2 million entries
>>>
>>> - pre-commit check of superblock to detect a mysterious in-memory
>>> corruption
>>>
>>> - log message updates
>>>
>>>
>>> Other changes:
>>>
>>> - orphan inode cleanup improved, does no keep long-standing reservations
>>> that
>>>could lead up to early ENOSPC in some cases
>>>
>>> - slight improvement of handling snapshotted NOCOW files by avoiding some
>>>unnecessary tree searches
>>>
>>> - avoid OOM when dealing with many unmergeable small extents at flush
>>> time
>>>
>>> - speedup conversion of free space tree representations from/to
>>> bitmap/tree
>>>
>>> - code refactoring, deletion, cleanups
>>>- delayed refs
>>>- delayed iput
>>>- redundant argument removals
>>>- memory barrier cleanups
>>>- remove a redundant mutex supposedly excluding several ioctls to run
>>> in
>>>  parallel
>>>
>>> - new tracepoints for blockgroup manipulation
>>>
>>> - more sanity checks of compressed headers
>>>
>>> 
>>> The following changes since commit
>>> b04e217704b7f879c6b91222b066983a44a7a09f:
>>>
>>>Linux 4.17-rc7 (2018-05-27 13:01:47 -0700)
>>>
>>> are available in the Git repository at:
>>>
>>>git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git
>>> for-4.18-tag
>>>
>>> for you to fetch changes up to 23d0b79dfaed2305b500b0215b0421701ada6b1a:
>>>
>>>btrfs: Add unprivileged version of ino_lookup ioctl (2018-05-31
>>> 11:35:24 +0200)
>>>
>>> 
>>> Al Viro (1):
>>>btrfs: take the last remnants of ->d_fsdata use out
>>>
>>> Anand Jain (19):
>>>btrfs: add comment about BTRFS_FS_EXCL_OP
>>>btrfs: rename struct btrfs_fs_devices::list
>>>btrfs: cleanup __btrfs_open_devices() drop head pointer
>>>btrfs: rename __btrfs_close_devices to close_fs_devices
>>>btrfs: rename __btrfs_open_devices to open_fs_devices
>>>btrfs: cleanup find_device() drop list_head pointer
>>>btrfs: cleanup btrfs_rm_device() promote fs_devices pointer
>>>btrfs: move btrfs_raid_type_names values to btrfs_raid_attr table
>>>btrfs: move btrfs_raid_group values to btrfs_raid_attr table
>>>btrfs: move btrfs_raid_mindev_errorvalues to btrfs_raid_attr table
>>>btrfs: reduce uuid_mutex critical section while scanning devices
>>>btrfs: use existing cur_devices, cleanup btrfs_rm_device
>>>btrfs: document uuid_mutex uasge in read_chunk_tree
>>>btrfs: replace uuid_mutex by device_list_mutex in
>>> btrfs_open_devices
>>
>>
>> This change (commit 542c5908abfe84f7b4c1717492ecc92ea0ea328d, "btrfs:
>> replace uuid_mutex by device_list_mutex in btrfs_open_devices"), at
>> the very least
>> introduces a lockdep warning:
>>
>> [  865.021049] ==
>> [  865.021950] WARNING: possible circular locking dependency detected
>> [  865.022828] 4.17.0-rc7-btrfs-next-59+ #1 Not tainted
>> [  865.023491] --
>> [  865.024342] fsstress/27897 is trying to acquire lock:
>> [  865.025070] 99260c12 (_info->reloc_mutex){+.+.}, at:
>> btrfs_record_root_in_trans+0x43/0x62 [btrfs]
>> [  865.026369]
>> [  865.026369] but task is already holding lock:
>> [  865.027206] 8dc17c22 (>mmap_sem){}, at:
>> vm_mmap_pgoff+0x77/0xe8
>> [  865.028251]

Re: [GIT PULL] Btrfs updates for 4.18

2018-06-11 Thread Anand Jain




On 06/10/2018 12:21 AM, Filipe Manana wrote:

On Mon, Jun 4, 2018 at 4:43 PM, David Sterba  wrote:

Hi,

there are some new features and a usual load of cleanups, more details below.

Specifically, there's a set of new non-privileged ioctls to allow
subvolume listing.  It works but still needs a security review as it's a
new interface and we might need to do some tweaks to the data
structures. The fixes could be considred regressions but may touch the
interfaces too.

Currently there are no merge conflicts but linux-next has reported a few
in the past, originating from other *FS trees.

Please pull, thanks.

---

User visible features:

- added support for the ioctl FS_IOC_FSGETXATTR, per-inode flags, successor
   of GET/SETFLAGS; now supports only existing flags: append, immutable,
   noatime, nodump, sync

- 3 new unprivileged ioctls to allow users to enumerate subvolumes

- dedupe syscall implementation does not restrict the range to 16MiB, though it
   still splits the whole range to 16MiB chunks

- on user demand, rmdir() is able to delete an empty subvolume, export the
   capability in sysfs

- fix inode number types in tracepoints, other cleanups

- send: improved speed when dealing with a large removed directory,
   measurements show decrease from 2000 minutes to 2 minutes on a directory with
   2 million entries

- pre-commit check of superblock to detect a mysterious in-memory corruption

- log message updates


Other changes:

- orphan inode cleanup improved, does no keep long-standing reservations that
   could lead up to early ENOSPC in some cases

- slight improvement of handling snapshotted NOCOW files by avoiding some
   unnecessary tree searches

- avoid OOM when dealing with many unmergeable small extents at flush time

- speedup conversion of free space tree representations from/to bitmap/tree

- code refactoring, deletion, cleanups
   - delayed refs
   - delayed iput
   - redundant argument removals
   - memory barrier cleanups
   - remove a redundant mutex supposedly excluding several ioctls to run in
 parallel

- new tracepoints for blockgroup manipulation

- more sanity checks of compressed headers


The following changes since commit b04e217704b7f879c6b91222b066983a44a7a09f:

   Linux 4.17-rc7 (2018-05-27 13:01:47 -0700)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.18-tag

for you to fetch changes up to 23d0b79dfaed2305b500b0215b0421701ada6b1a:

   btrfs: Add unprivileged version of ino_lookup ioctl (2018-05-31 11:35:24 
+0200)


Al Viro (1):
   btrfs: take the last remnants of ->d_fsdata use out

Anand Jain (19):
   btrfs: add comment about BTRFS_FS_EXCL_OP
   btrfs: rename struct btrfs_fs_devices::list
   btrfs: cleanup __btrfs_open_devices() drop head pointer
   btrfs: rename __btrfs_close_devices to close_fs_devices
   btrfs: rename __btrfs_open_devices to open_fs_devices
   btrfs: cleanup find_device() drop list_head pointer
   btrfs: cleanup btrfs_rm_device() promote fs_devices pointer
   btrfs: move btrfs_raid_type_names values to btrfs_raid_attr table
   btrfs: move btrfs_raid_group values to btrfs_raid_attr table
   btrfs: move btrfs_raid_mindev_errorvalues to btrfs_raid_attr table
   btrfs: reduce uuid_mutex critical section while scanning devices
   btrfs: use existing cur_devices, cleanup btrfs_rm_device
   btrfs: document uuid_mutex uasge in read_chunk_tree
   btrfs: replace uuid_mutex by device_list_mutex in btrfs_open_devices


This change (commit 542c5908abfe84f7b4c1717492ecc92ea0ea328d, "btrfs:
replace uuid_mutex by device_list_mutex in btrfs_open_devices"), at
the very least
introduces a lockdep warning:

[  865.021049] ==
[  865.021950] WARNING: possible circular locking dependency detected
[  865.022828] 4.17.0-rc7-btrfs-next-59+ #1 Not tainted
[  865.023491] --
[  865.024342] fsstress/27897 is trying to acquire lock:
[  865.025070] 99260c12 (_info->reloc_mutex){+.+.}, at:
btrfs_record_root_in_trans+0x43/0x62 [btrfs]
[  865.026369]
[  865.026369] but task is already holding lock:
[  865.027206] 8dc17c22 (>mmap_sem){}, at:
vm_mmap_pgoff+0x77/0xe8
[  865.028251]
[  865.028251] which lock already depends on the new lock.
[  865.028251]
[  865.029482]
[  865.029482] the existing dependency chain (in reverse order) is:
[  865.030523]
[  865.030523] -> #7 (>mmap_sem){}:
[  865.031241]_copy_to_user+0x1e/0x63
[  865.031745]filldir+0x9e/0xef
[  865.032285]dir_emit_dots+0x3b/0xbd
[  865.032881]dcache_readdir+0x22/0xbb
[  865.033502]iterate_dir+0xa3/0x13e
[  865.034131]__do_sys_getdents+0xa1/0x106
[  865.034821]

Re: [GIT PULL] Btrfs updates for 4.18

2018-06-09 Thread Filipe Manana
On Mon, Jun 4, 2018 at 4:43 PM, David Sterba  wrote:
> Hi,
>
> there are some new features and a usual load of cleanups, more details below.
>
> Specifically, there's a set of new non-privileged ioctls to allow
> subvolume listing.  It works but still needs a security review as it's a
> new interface and we might need to do some tweaks to the data
> structures. The fixes could be considred regressions but may touch the
> interfaces too.
>
> Currently there are no merge conflicts but linux-next has reported a few
> in the past, originating from other *FS trees.
>
> Please pull, thanks.
>
> ---
>
> User visible features:
>
> - added support for the ioctl FS_IOC_FSGETXATTR, per-inode flags, successor
>   of GET/SETFLAGS; now supports only existing flags: append, immutable,
>   noatime, nodump, sync
>
> - 3 new unprivileged ioctls to allow users to enumerate subvolumes
>
> - dedupe syscall implementation does not restrict the range to 16MiB, though 
> it
>   still splits the whole range to 16MiB chunks
>
> - on user demand, rmdir() is able to delete an empty subvolume, export the
>   capability in sysfs
>
> - fix inode number types in tracepoints, other cleanups
>
> - send: improved speed when dealing with a large removed directory,
>   measurements show decrease from 2000 minutes to 2 minutes on a directory 
> with
>   2 million entries
>
> - pre-commit check of superblock to detect a mysterious in-memory corruption
>
> - log message updates
>
>
> Other changes:
>
> - orphan inode cleanup improved, does no keep long-standing reservations that
>   could lead up to early ENOSPC in some cases
>
> - slight improvement of handling snapshotted NOCOW files by avoiding some
>   unnecessary tree searches
>
> - avoid OOM when dealing with many unmergeable small extents at flush time
>
> - speedup conversion of free space tree representations from/to bitmap/tree
>
> - code refactoring, deletion, cleanups
>   - delayed refs
>   - delayed iput
>   - redundant argument removals
>   - memory barrier cleanups
>   - remove a redundant mutex supposedly excluding several ioctls to run in
> parallel
>
> - new tracepoints for blockgroup manipulation
>
> - more sanity checks of compressed headers
>
> 
> The following changes since commit b04e217704b7f879c6b91222b066983a44a7a09f:
>
>   Linux 4.17-rc7 (2018-05-27 13:01:47 -0700)
>
> are available in the Git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.18-tag
>
> for you to fetch changes up to 23d0b79dfaed2305b500b0215b0421701ada6b1a:
>
>   btrfs: Add unprivileged version of ino_lookup ioctl (2018-05-31 11:35:24 
> +0200)
>
> 
> Al Viro (1):
>   btrfs: take the last remnants of ->d_fsdata use out
>
> Anand Jain (19):
>   btrfs: add comment about BTRFS_FS_EXCL_OP
>   btrfs: rename struct btrfs_fs_devices::list
>   btrfs: cleanup __btrfs_open_devices() drop head pointer
>   btrfs: rename __btrfs_close_devices to close_fs_devices
>   btrfs: rename __btrfs_open_devices to open_fs_devices
>   btrfs: cleanup find_device() drop list_head pointer
>   btrfs: cleanup btrfs_rm_device() promote fs_devices pointer
>   btrfs: move btrfs_raid_type_names values to btrfs_raid_attr table
>   btrfs: move btrfs_raid_group values to btrfs_raid_attr table
>   btrfs: move btrfs_raid_mindev_errorvalues to btrfs_raid_attr table
>   btrfs: reduce uuid_mutex critical section while scanning devices
>   btrfs: use existing cur_devices, cleanup btrfs_rm_device
>   btrfs: document uuid_mutex uasge in read_chunk_tree
>   btrfs: replace uuid_mutex by device_list_mutex in btrfs_open_devices

This change (commit 542c5908abfe84f7b4c1717492ecc92ea0ea328d, "btrfs:
replace uuid_mutex by device_list_mutex in btrfs_open_devices"), at
the very least
introduces a lockdep warning:

[  865.021049] ==
[  865.021950] WARNING: possible circular locking dependency detected
[  865.022828] 4.17.0-rc7-btrfs-next-59+ #1 Not tainted
[  865.023491] --
[  865.024342] fsstress/27897 is trying to acquire lock:
[  865.025070] 99260c12 (_info->reloc_mutex){+.+.}, at:
btrfs_record_root_in_trans+0x43/0x62 [btrfs]
[  865.026369]
[  865.026369] but task is already holding lock:
[  865.027206] 8dc17c22 (>mmap_sem){}, at:
vm_mmap_pgoff+0x77/0xe8
[  865.028251]
[  865.028251] which lock already depends on the new lock.
[  865.028251]
[  865.029482]
[  865.029482] the existing dependency chain (in reverse order) is:
[  865.030523]
[  865.030523] -> #7 (>mmap_sem){}:
[  865.031241]_copy_to_user+0x1e/0x63
[  865.031745]filldir+0x9e/0xef
[  865.032285]dir_emit_dots+0x3b/0xbd
[  865.032881]dcache_readdir+0x22/0xbb
[  865.033502]iterate_dir+0xa3/0x13e
[  

[GIT PULL] Btrfs fix for 4.17-rc6

2018-05-24 Thread David Sterba
Hi,

please consider pulling a fix for btrfs. This time it's really a
one-liner and prevents leaking an internal error value 1 out of the
ftruncate syscall.

This has been observed in practice. The steps to reproduce make a common
pattern (open/write/fync/ftruncate) but also need the application to not
check only for negative values and happens only for compressed inlined
files. The conditions are narrow but as this could break userspace I
think it's better to merge it now and not wait for the merge window.
Thanks.


The following changes since commit 02ee654d3a04563c67bfe658a05384548b9bb105:

  btrfs: fix crash when trying to resume balance without the resume flag 
(2018-05-17 14:38:24 +0200)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.17-rc6-tag

for you to fetch changes up to d50147381aa0c9725d63a677c138c47f55d6d3bc:

  Btrfs: fix error handling in btrfs_truncate() (2018-05-24 11:56:57 +0200)


Omar Sandoval (1):
  Btrfs: fix error handling in btrfs_truncate()

 fs/btrfs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.17-rc6

2018-05-20 Thread Linus Torvalds
On Sun, May 20, 2018 at 8:21 AM David Sterba  wrote:

> They IMHO qualify for a late rc, though I did not expect that many.

Especially with the tree-log.c changes being fairly big, I took a look, and
I have to say that I appreciate (a) the warning in the pull request and (b)
the extensive log messages explaining the problems these patches fix.

I obviously still prefer to see only small and simple one-liners just
before I'm making ready to release rc6, but in the absence of oneliners I
do appreciate good explanations.

Thanks,

   Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.17-rc6

2018-05-20 Thread David Sterba
Hi,

we've accumulated some fixes during the last week, some of them were in
the works for a longer time but there are some newer ones too. Most of
the fixes have a reproducer and fix user visible problems, also
candidates for stable kernels. They IMHO qualify for a late rc, though I
did not expect that many.

The commit date may differ from author date because I added the stable
and Fixes tags where missing. There are no merge conflicts against
current master.

Please pull, thanks.


The following changes since commit a6aa10c70bf72fb28504cb5de5deac75da78b0f5:

  Btrfs: send, fix missing truncate for inode with prealloc extent past eof 
(2018-05-02 11:55:29 +0200)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.17-rc5-tag

for you to fetch changes up to 02ee654d3a04563c67bfe658a05384548b9bb105:

  btrfs: fix crash when trying to resume balance without the resume flag 
(2018-05-17 14:38:24 +0200)


Anand Jain (1):
  btrfs: fix crash when trying to resume balance without the resume flag

Filipe Manana (2):
  Btrfs: fix xattr loss after power failure
  Btrfs: fix duplicate extents after fsync of file with prealloc extents

Liu Bo (1):
  btrfs: fix reading stale metadata blocks after degraded raid1 mounts

Misono Tomohiro (1):
  btrfs: property: Set incompat flag if lzo/zstd compression is set

Nikolay Borisov (2):
  btrfs: Split btrfs_del_delalloc_inode into 2 functions
  btrfs: Fix delalloc inodes invalidation during transaction abort

Robbie Ko (1):
  Btrfs: send, fix invalid access to commit roots due to concurrent 
snapshotting

 fs/btrfs/ctree.c|  22 ++--
 fs/btrfs/ctree.h|   2 +
 fs/btrfs/disk-io.c  |  26 ++
 fs/btrfs/inode.c|  13 +++--
 fs/btrfs/props.c|  12 +++--
 fs/btrfs/tree-log.c | 144 +++-
 fs/btrfs/volumes.c  |   9 
 7 files changed, 180 insertions(+), 48 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs updates for 4.17-rc3

2018-05-04 Thread David Sterba
Hi,

please pull the following branch with 2 regression fixes and one fix for
stable. Thanks.


The following changes since commit c0872323746e11fc79344e3738b283a8cda86654:

  btrfs: print-tree: debugging output enhancement (2018-04-20 19:18:16 +0200)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.17-rc3-tag

for you to fetch changes up to a6aa10c70bf72fb28504cb5de5deac75da78b0f5:

  Btrfs: send, fix missing truncate for inode with prealloc extent past eof 
(2018-05-02 11:55:29 +0200)


Filipe Manana (1):
  Btrfs: send, fix missing truncate for inode with prealloc extent past eof

Qu Wenruo (1):
  btrfs: Fix wrong first_key parameter in replace_path

ethanwu (1):
  btrfs: Take trans lock before access running trans in check_delayed_ref

 fs/btrfs/extent-tree.c | 7 +++
 fs/btrfs/relocation.c  | 2 +-
 fs/btrfs/send.c| 4 
 3 files changed, 12 insertions(+), 1 deletion(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.17-rc1

2018-04-22 Thread David Sterba
Hi,

the branch contains a few fixups to qgroup patches that were merged this
dev cycle, unaligned access fix, blockgroup removal corner case fix and
a small debugging output tweak.

Please pull, thanks.


The following changes since commit 5d41be6f702f19f72db816c17175caf9dbdcdfa6:

  btrfs: Only check first key for committed tree blocks (2018-04-13 16:16:15 
+0200)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.17-rc1-tag

for you to fetch changes up to c0872323746e11fc79344e3738b283a8cda86654:

  btrfs: print-tree: debugging output enhancement (2018-04-20 19:18:16 +0200)


David Sterba (1):
  btrfs: fix unaligned access in readdir

Nikolay Borisov (1):
  btrfs: Fix race condition between delayed refs and blockgroup removal

Qu Wenruo (5):
  btrfs: qgroup: Commit transaction in advance to reduce early EDQUOT
  btrfs: qgroup: Use independent and accurate per inode qgroup rsv
  btrfs: delayed-inode: Remove wrong qgroup meta reservation calls
  btrfs: Fix wrong btrfs_delalloc_release_extents parameter
  btrfs: print-tree: debugging output enhancement

 fs/btrfs/ctree.h | 25 +
 fs/btrfs/delayed-inode.c | 20 ++---
 fs/btrfs/delayed-ref.c   | 19 +
 fs/btrfs/delayed-ref.h   |  1 +
 fs/btrfs/disk-io.c   |  1 +
 fs/btrfs/extent-tree.c   | 73 +---
 fs/btrfs/file.c  |  2 +-
 fs/btrfs/inode.c | 20 +++--
 fs/btrfs/print-tree.c| 25 ++---
 fs/btrfs/print-tree.h|  2 +-
 fs/btrfs/qgroup.c| 43 ++--
 fs/btrfs/transaction.c   |  1 +
 fs/btrfs/transaction.h   | 14 ++
 13 files changed, 199 insertions(+), 47 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs updates for 4.17, part 2

2018-04-15 Thread David Sterba
Hi,

we have queued a few more fixes (error handling, log replay, softlockup)
and the rest is SPDX update that touches almost all files so the
diffstat is long. The top patch is a fixup for excessive warning and
was not in linux-next but I've tested it locally.

Please pull, thanks.


The following changes since commit 57599c7e7722daf5f8c2dba4b0e4628f5c500771:

  btrfs: lift errors from add_extent_changeset to the callers (2018-03-31 
02:03:25 +0200)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git 
for-4.17-part2-tag

for you to fetch changes up to 5d41be6f702f19f72db816c17175caf9dbdcdfa6:

  btrfs: Only check first key for committed tree blocks (2018-04-13 16:16:15 
+0200)


David Sterba (3):
  btrfs: replace GPL boilerplate by SPDX -- headers
  btrfs: replace GPL boilerplate by SPDX -- sources
  btrfs: add SPDX header to Kconfig

Filipe Manana (1):
  Btrfs: fix loss of prealloc extents past i_size after fsync log replay

Liu Bo (3):
  Btrfs: fix NULL pointer dereference in log_dir_items
  Btrfs: bail out on error during replay_dir_deletes
  Btrfs: clean up resources during umount after trans is aborted

Nikolay Borisov (1):
  btrfs: Fix possible softlock on single core machines

Qu Wenruo (1):
  btrfs: Only check first key for committed tree blocks

 fs/btrfs/Kconfig   |  2 +
 fs/btrfs/acl.c | 15 +-
 fs/btrfs/async-thread.c| 15 +-
 fs/btrfs/async-thread.h| 21 ++--
 fs/btrfs/backref.c | 15 +-
 fs/btrfs/backref.h | 19 ++--
 fs/btrfs/btrfs_inode.h | 19 ++--
 fs/btrfs/check-integrity.c | 15 +-
 fs/btrfs/check-integrity.h | 19 ++--
 fs/btrfs/compression.c | 15 +-
 fs/btrfs/compression.h | 19 ++--
 fs/btrfs/ctree.c   | 15 +-
 fs/btrfs/ctree.h   | 20 ++--
 fs/btrfs/dedupe.h  | 20 ++--
 fs/btrfs/delayed-inode.c   | 15 +-
 fs/btrfs/delayed-inode.h   | 19 ++--
 fs/btrfs/delayed-ref.c | 15 +-
 fs/btrfs/delayed-ref.h | 21 ++--
 fs/btrfs/dev-replace.c | 16 +-
 fs/btrfs/dev-replace.h | 20 ++--
 fs/btrfs/dir-item.c| 15 +-
 fs/btrfs/disk-io.c | 26 +-
 fs/btrfs/disk-io.h | 20 ++--
 fs/btrfs/export.c  |  1 +
 fs/btrfs/export.h  |  1 +
 fs/btrfs/extent-tree.c | 17 ++-
 fs/btrfs/extent_io.c   |  1 +
 fs/btrfs/extent_io.h   |  6 ++-
 fs/btrfs/extent_map.c  |  1 +
 fs/btrfs/extent_map.h  |  6 ++-
 fs/btrfs/file-item.c   | 15 +-
 fs/btrfs/file.c| 15 +-
 fs/btrfs/free-space-cache.c| 15 +-
 fs/btrfs/free-space-cache.h| 19 ++--
 fs/btrfs/free-space-tree.c | 15 +-
 fs/btrfs/free-space-tree.h | 19 ++--
 fs/btrfs/inode-item.c  | 15 +-
 fs/btrfs/inode-map.c   | 15 +-
 fs/btrfs/inode-map.h   |  5 +-
 fs/btrfs/inode.c   | 15 +-
 fs/btrfs/ioctl.c   | 15 +-
 fs/btrfs/locking.c | 16 +-
 fs/btrfs/locking.h | 19 ++--
 fs/btrfs/lzo.c | 15 +-
 fs/btrfs/math.h| 20 ++--
 fs/btrfs/ordered-data.c| 15 +-
 fs/btrfs/ordered-data.h| 20 ++--
 fs/btrfs/orphan.c  | 15 +-
 fs/btrfs/print-tree.c  | 15 +-
 fs/btrfs/print-tree.h  | 21 ++--
 fs/btrfs/props.c   | 15 +-
 fs/btrfs/props.h   | 19 ++--
 fs/btrfs/qgroup.c  | 15 +-
 fs/btrfs/qgroup.h  | 22 ++---
 fs/btrfs/raid56.c  | 16 +-
 fs/btrfs/raid56.h  | 21 ++--
 fs/btrfs/rcu-string.h  | 20 +++-
 fs/btrfs/reada.c   | 15 +-
 fs/btrfs/ref-verify.c  | 15 +-
 fs/btrfs/ref-verify.h  | 23 +++--
 fs/btrfs/relocation.c  | 15 +-
 fs/btrfs/root-tree.c   | 15 +-
 fs/btrfs/scrub.c   | 15 +-
 fs/btrfs/send.c| 15 +-
 fs/btrfs/send.h| 20 +++-
 fs/btrfs/struct-funcs.c| 15 +-
 fs/btrfs/super.c   | 15 +-
 

[GIT PULL] Btrfs updates for 4.17

2018-04-03 Thread David Sterba
Hi,

please pull the following btrfs changes. There are a several user
visible changes, the rest is mostly invisible and continues to clean up
the whole code base.

There are no merge conflicts with current master. Please pull, thanks.

User visible changes:

  - new mount option nossd_spread (pair for ssd_spread)

  - mount option subvolid will detect junk after the number and fail the mount

  - add message after cancelled device replace

  - direct module dependency on libcrc32, removed own crc wrappers

  - removed user space transaction ioctls

  - use lighter locking when reading /proc/self/mounts, RCU instead of mutex
to avoid unnecessary contention

Enhancements:

  - skip writeback of last page when truncating file to same size

  - send: do not issue unnecessary truncate operations

  - mount option token specifiers: use %u for unsigned values, more validation

  - selftests: more tree block validations

qgroups:

  - preparatory work for splitting reservation types for data and metadata,
this should allow for more accurate tracking and fix some issues with
underflows or do further enhancements

  - split metadata reservations for started and joined transaction so they do
not get mixed up and are accounted correctly at commit time

  - with the above, it's possible to revert patch that potentially deadlocks
when trying to make more space by explicitly committing when the quota
limit is hit

  - fix root item corruption when multiple same source snapshots are created
with quota enabled

RAID56:

  - make sure target is identical to source when raid56 rebuild fails after
dev-replace

  - faster rebuild during scrub, batch by stripes and not block-by-block

  - make more use of cached data when rebuilding from a missing device

Fixes:

  - null pointer deref when device replace target is missing

  - fix fsync after hole punching when using no-holes feature

  - fix lockdep splat when allocating percpu data with wrong GFP flags

Cleanups, refactoring, core changes:

  - drop redunant parameters from various functions

  - kill and opencode trivial helpers

  - __cold/__exit function annotations

  - dead code removal

  - continued audit and documentation of memory barriers

  - error handling: handle removal from uuid tree

  - error handling: remove handling of impossible condtitons

  - more debugging or error messages

  - updated tracepoints

  - 1 VLA use removal (1 still left)


The following changes since commit 3eb2ce825ea1ad89d20f7a3b5780df850e4be274:

  Linux 4.16-rc7 (2018-03-25 12:44:30 -1000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.17-tag

for you to fetch changes up to 57599c7e7722daf5f8c2dba4b0e4628f5c500771:

  btrfs: lift errors from add_extent_changeset to the callers (2018-03-31 
02:03:25 +0200)


Anand Jain (25):
  btrfs: open code btrfs_dev_replace_cancel()
  btrfs: rename __btrfs_dev_replace_cancel()
  btrfs: btrfs_dev_replace_cancel() can return int
  btrfs: open code btrfs_init_dev_replace_tgtdev_for_resume()
  btrfs: extent_buffer_uptodate() make it static and inline
  btrfs: manage thread_pool mount option as %u
  btrfs: manage metadata_ratio mount option as %u
  btrfs: manage check_int_print_mask mount option as %u
  btrfs: manage commit mount option as %u
  btrfs: add a comment to mark the deprecated mount option
  btrfs: fix null pointer deref when target device is missing
  btrfs: log, when replace, is canceled by the user
  btrfs: remove unused function btrfs_async_submit_limit()
  btrfs: cow_file_range() num_bytes and disk_num_bytes are same
  btrfs: use ASSERT to report logical error in cow_file_range()
  btrfs: not a disk error if the bio_add_page fails
  btrfs: keep device list sorted
  btrfs: insert newly opened device to the end of the list
  btrfs: verify subvolid mount parameter
  btrfs: remove assert in btrfs_init_dev_replace_tgtdev()
  btrfs: unify types for metadata_ratio and data_chunk_allocations
  btrfs: rename btrfs_close_extra_device to btrfs_free_extra_devids
  btrfs: add define for oldest generation
  btrfs: drop num argument from find_live_mirror()
  btrfs: drop optimal argument from find_live_mirror()

Colin Ian King (2):
  btrfs: remove redundant check on ret and goto
  Btrfs: extent map selftest: add missing void parameter to 
btrfs_test_extent_map

David Sterba (37):
  btrfs: add (the only possible) __exit annotation
  btrfs: add more __cold annotations
  btrfs: drop underscores from exported xattr functions
  btrfs: drop extern from function declarations
  btrfs: adjust return type of btrfs_getxattr
  btrfs: move btrfs_listxattr prototype to xattr.h
  btrfs: open code trivial helper 

[GIT PULL] Btrfs fixes for 4.16-rc6

2018-03-16 Thread David Sterba
Hi,

there's an important revert in this pull request that needs to go to
stable as it causes a corruption on big endian machines. The other fix
is for FIEMAP incorrectly reporting shared extents before a sync and one
fix for a crash in raid56.

So far we got only one report about the BE corruption, the stable
kernels were out for like a week, so hopefully the scope of the damage
is low.

Please pull, thanks.


The following changes since commit 1f250e929a9c9332fd6ea34da684afee73837cfe:

  Btrfs: fix log replay failure after unlink and link combination (2018-03-01 
16:18:40 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.16-rc5-tag

for you to fetch changes up to 093e037ca88e1767693bc6bcb2df3f49c6be68c7:

  Revert "btrfs: use proper endianness accessors for super_copy" (2018-03-16 
14:49:44 +0100)


David Sterba (1):
  Revert "btrfs: use proper endianness accessors for super_copy"

Dmitriy Gorokh (1):
  btrfs: Fix NULL pointer exception in find_bio_stripe

Edmund Nadolski (1):
  btrfs: add missing initialization in btrfs_check_shared

 fs/btrfs/backref.c |  1 +
 fs/btrfs/raid56.c  |  1 +
 fs/btrfs/sysfs.c   |  8 +---
 fs/btrfs/transaction.c | 20 
 4 files changed, 15 insertions(+), 15 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.16-rc4

2018-03-04 Thread David Sterba
Hi,

please consider the follwing btrfs updates, there are bugfixes or fixes
for user visible behaviour.

No merge conflicts. Please pull, thanks.

- when NR_CPUS is large, a SRCU structure can significantly inflate size
  of the main filesystem structure that would not be possible to
  allocate by kmalloc, so the kvalloc fallback is used

- improved error handling

- fix endiannes when printing some filesystem attributes via sysfs, this
  is could happen when a filesystem is moved between different endianity
  hosts

- send fixes: the NO_HOLE mode should not send a write operation for a
  file hole

- fix log replay for for special files followed by file hardlinks

- fix log replay failure after unlink and link combination

- fix max chunk size calculation for DUP allocation


The following changes since commit fd649f10c3d21ee9d7542c609f29978bdf73ab94:

  btrfs: Fix use-after-free when cleaning up fs_devs with a single stale device 
(2018-02-05 17:15:14 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.16-rc3-tag

for you to fetch changes up to 1f250e929a9c9332fd6ea34da684afee73837cfe:

  Btrfs: fix log replay failure after unlink and link combination (2018-03-01 
16:18:40 +0100)


Anand Jain (1):
  btrfs: use proper endianness accessors for super_copy

Filipe Manana (3):
  Btrfs: send, fix issuing write op when processing hole in no data mode
  Btrfs: fix log replay failure after linking special file and fsync
  Btrfs: fix log replay failure after unlink and link combination

Hans van Kranenburg (1):
  btrfs: alloc_chunk: fix DUP stripe size handling

Jeff Mahoney (1):
  btrfs: use kvzalloc to allocate btrfs_fs_info

Nikolay Borisov (2):
  btrfs: handle failure of add_pending_csums
  btrfs: Handle btrfs_set_extent_delalloc failure in 
relocate_file_extent_cluster

 fs/btrfs/ctree.h   |   7 ++-
 fs/btrfs/inode-item.c  |  44 +++
 fs/btrfs/inode.c   |  11 -
 fs/btrfs/relocation.c  |  18 +++-
 fs/btrfs/send.c|   3 ++
 fs/btrfs/super.c   |   2 +-
 fs/btrfs/sysfs.c   |   8 ++--
 fs/btrfs/transaction.c |  20 +
 fs/btrfs/tree-log.c| 114 +++--
 fs/btrfs/volumes.c |  11 ++---
 10 files changed, 191 insertions(+), 47 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.16-rc1

2018-02-16 Thread David Sterba
Hi,

we have a few assorted fixes, some of them show up during fstests so
I gave them more testing. Please pull, thanks.


The following changes since commit 3acbcbfc8f06d4ade2aab2ebba0a2542a05ce90c:

  btrfs: drop devid as device_list_add() arg (2018-01-29 19:31:16 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.16-rc1-tag

for you to fetch changes up to fd649f10c3d21ee9d7542c609f29978bdf73ab94:

  btrfs: Fix use-after-free when cleaning up fs_devs with a single stale device 
(2018-02-05 17:15:14 +0100)


Filipe Manana (1):
  Btrfs: fix null pointer dereference when replacing missing device

Liu Bo (6):
  Btrfs: fix deadlock in run_delalloc_nocow
  Btrfs: fix crash due to not cleaning up tree log block's dirty bits
  Btrfs: fix extent state leak from tree log
  Btrfs: fix btrfs_evict_inode to handle abnormal inodes correctly
  Btrfs: fix use-after-free on root->orphan_block_rsv
  Btrfs: fix unexpected -EEXIST when creating new inode

Nikolay Borisov (2):
  btrfs: Ignore errors from btrfs_qgroup_trace_extent_post
  btrfs: Fix use-after-free when cleaning up fs_devs with a single stale 
device

Zygo Blaxell (1):
  btrfs: remove spurious WARN_ON(ref->count < 0) in find_parent_nodes

 fs/btrfs/backref.c | 11 ++-
 fs/btrfs/delayed-ref.c |  3 ++-
 fs/btrfs/extent-tree.c |  4 
 fs/btrfs/inode.c   | 41 ++---
 fs/btrfs/qgroup.c  |  9 +++--
 fs/btrfs/tree-log.c| 32 ++--
 fs/btrfs/volumes.c |  1 +
 7 files changed, 80 insertions(+), 21 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs for 4.16

2018-01-29 Thread David Sterba
Hi,

the btrfs updates for this cycle are mostly cleanups with a few raid56 bugfixes
and some feature additions. Please pull, thanks.


Features or user visible changes:

- fallocate: implement zero range mode

- avoid losing data raid profile when deleting a device

- tree item checker: more checks for directory items and xattrs

Notable fixes:

- raid56 recovery: don't use cached stripes, that could be potentially changed
  and a later RMW or recovery would lead to corruptions or failures

- let raid56 try harder to rebuild damaged data, reading from all stripes if
  necessary

- fix scrub to repair raid56 in a similar way as in the case above

Other:

- cleanups: device freeing, removed some call indirections, redundant
  bio_put/_get, unused parameters, refactorings and renames

- RCU list traversal fixups

- simplify mount callchain, remove recursing back when mounting a subvolume

- plug for fsync, may improve bio merging on multiple devices

- compression heurisic: replace heap sort with radix sort, gains some
  performance

- add extent map selftests, buffered write vs dio



The following changes since commit 0c5b9b5d9adbad4b60491f9ba0d2af38904bb4b9:

  Linux 4.15-rc9 (2018-01-21 13:51:26 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.16-tag

for you to fetch changes up to 3acbcbfc8f06d4ade2aab2ebba0a2542a05ce90c:

  btrfs: drop devid as device_list_add() arg (2018-01-29 19:31:16 +0100)


Anand Jain (33):
  btrfs: clean up btrfs_dev_stat_inc usage
  btrfs: move volume_mutex into the btrfs_rm_device()
  btrfs: rename btrfs_add_device to btrfs_add_dev_item
  btrfs: set fs_devices->seed directly
  btrfs: move check for device generation to the last
  btrfs: factor __btrfs_open_devices() to create btrfs_open_one_device()
  btrfs: drop btrfs_device::can_discard to query directly
  btrfs: add helper for device path or missing
  btrfs: cleanup device states define BTRFS_DEV_STATE_WRITEABLE
  btrfs: cleanup device states define BTRFS_DEV_STATE_IN_FS_METADATA
  btrfs: cleanup device states define BTRFS_DEV_STATE_MISSING
  btrfs: cleanup device states define BTRFS_DEV_STATE_REPLACE_TGT
  btrfs: cleanup device states define BTRFS_DEV_STATE_FLUSH_SENT
  btrfs: put btrfs_ioctl_vol_args_v2 related defines together
  btrfs: factor btrfs_check_rw_degradable() to check given device
  btrfs: remove check for BTRFS_FS_STATE_ERROR which we just set
  btrfS: collapse btrfs_handle_error() into __btrfs_handle_fs_error()
  btrfs: rename btrfs_device::scrub_device to scrub_ctx
  btrfs: simplify mutex unlocking code in btrfs_commit_transaction
  btrfs: minor style cleanups in btrfs_scan_one_device
  btrfs: define SUPER_FLAG_METADUMP_V2
  btrfs: add support for SUPER_FLAG_CHANGING_FSID
  btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP
  btrfs: cleanup btrfs_free_stale_device() usage
  btrfs: no need to check for btrfs_fs_devices::seeding
  btrfs: make btrfs_free_stale_device() to iterate all stales
  btrfs: make btrfs_free_stale_devices() argument optional
  btrfs: rename btrfs_free_stale_devices() arg to skip_dev
  btrfs: make btrfs_free_stale_devices() to match the path
  btrfs: move pr_info into device_list_add
  btrfs: set the total_devices in device_list_add()
  btrfs: get device pointer from device_list_add()
  btrfs: drop devid as device_list_add() arg

Arnd Bergmann (1):
  btrfs: tree-checker: use %zu format string for size_t

Colin Ian King (1):
  btrfs: make function update_share_count static

David Sterba (46):
  btrfs: rename device free rcu helper to free_device_rcu
  btrfs: introduce free_device helper
  btrfs: use free_device where opencoded
  btrfs: simplify exit paths in btrfs_init_new_device
  btrfs: document device locking
  btrfs: simplify btrfs_close_bdev
  btrfs: switch to RCU for device traversal in btrfs_ioctl_dev_info
  btrfs: switch to RCU for device traversal in btrfs_ioctl_fs_info
  btrfs: use non-RCU list traversal in write_all_supers callees
  btrfs: prepare to drop gfp mask parameter from clear_extent_bit
  btrfs: sink gfp parameter to clear_extent_bit
  btrfs: sink gfp parameter to clear_extent_uptodate
  btrfs: use GFP_KERNEL in btrfs_alloc_inode
  btrfs: sink get_extent parameter to extent_writepages
  btrfs: sink get_extent parameter to extent_write_locked_range
  btrfs: sink get_extent parameter to extent_write_full_page
  btrfs: drop get_extent from extent_page_data
  btrfs: sink get_extent parameter to extent_fiemap
  btrfs: sink get_extent parameter to get_extent_skip_holes
  btrfs: sink get_extent parameter to extent_readpages
  btrfs: sink get_extent 

[GIT PULL] Btrfs readdir fix for 4.15

2018-01-25 Thread David Sterba
Hi,

please consider pulling the fix to 4.15. It's been reported recently
that readdir can list stale entries under some conditions. As it is a
user visible bug I'd like to get it fix despite we're in the late rc.
Thanks.

The following changes since commit ec35e48b286959991cdbb886f1bdeda4575c80b4:

  btrfs: fix refcount_t usage when deleting btrfs_delayed_nodes (2018-01-02 
18:00:14 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15-tag

for you to fetch changes up to e4fd493c0541d36953f7b9d3bfced67a1321792f:

  Btrfs: fix stale entries in readdir (2018-01-24 20:27:48 +0100)


Josef Bacik (1):
  Btrfs: fix stale entries in readdir

 fs/btrfs/delayed-inode.c | 26 --
 1 file changed, 8 insertions(+), 18 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.15-rc7

2018-01-05 Thread David Sterba
Hi,

we have two more fixes for 4.15, aimed for stable. The leak fix is
obvious, the second patch fixes a bug revealed by the refcount API, when
it behaves differently than previous atomic_t and reports refs going
from 0 to 1 in one case.

No merge conflicts. Please pull, thanks.

The following changes since commit c8bcbfbd239ed60a6562964b58034ac8a25f4c31:

  btrfs: Fix possible off-by-one in btrfs_search_path_in_tree (2017-12-07 
00:35:15 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15-rc7-tag

for you to fetch changes up to ec35e48b286959991cdbb886f1bdeda4575c80b4:

  btrfs: fix refcount_t usage when deleting btrfs_delayed_nodes (2018-01-02 
18:00:14 +0100)


Chris Mason (1):
  btrfs: fix refcount_t usage when deleting btrfs_delayed_nodes

Nikolay Borisov (1):
  btrfs: Fix flush bio leak

 fs/btrfs/delayed-inode.c | 45 ++---
 fs/btrfs/volumes.c   |  1 -
 2 files changed, 34 insertions(+), 12 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.15-rc3

2017-12-09 Thread David Sterba
Hi,

this update contains a few fixes (error handling, quota leak, FUA vs
nobarrier mount option).  There's one one worth mentioning separately -
an off-by-one fix that leads to overwriting first byte of an adjacent
page with 0, out of bounds of the memory allocated by an ioctl.  This is
under a privileged part of the ioctl, can be triggerd in some subvolume
layouts.

After the last tags and branches mess [1], let me note that the pull url
is pointed to the signed tag. There are no merge conflics. Please pull,
thanks.

[1] https://lkml.org/lkml/2017/11/29/952


The following changes since commit ea37d5998b50a72b9045ba60a132eeb20e1c4230:

  Btrfs: incremental send, fix wrong unlink path after renaming file 
(2017-11-28 17:15:30 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15-rc3-tag

for you to fetch changes up to c8bcbfbd239ed60a6562964b58034ac8a25f4c31:

  btrfs: Fix possible off-by-one in btrfs_search_path_in_tree (2017-12-07 
00:35:15 +0100)


Jeff Mahoney (2):
  btrfs: handle errors while updating refcounts in update_ref_for_cow
  btrfs: fix missing error return in btrfs_drop_snapshot

Justin Maggard (1):
  btrfs: Fix quota reservation leak on preallocated files

Nikolay Borisov (1):
  btrfs: Fix possible off-by-one in btrfs_search_path_in_tree

Omar Sandoval (1):
  Btrfs: disable FUA if mounted with nobarrier

 fs/btrfs/ctree.c   | 18 --
 fs/btrfs/disk-io.c | 12 +---
 fs/btrfs/extent-tree.c |  1 +
 fs/btrfs/inode.c   |  2 ++
 fs/btrfs/ioctl.c   |  2 +-
 5 files changed, 21 insertions(+), 14 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.15-rc2

2017-11-30 Thread David Sterba
On Wed, Nov 29, 2017 at 02:31:24PM -0800, Linus Torvalds wrote:
> On Wed, Nov 29, 2017 at 11:28 AM, David Sterba  wrote:
> >
> > With signed tag: for-4.15-rc2-tag
> >
> >   git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15-rc2
> 
> Oh, please actually ask me to pull the signed tag (exact same
> pull-request, just point git request-pull at the tag),

Will do next time.

> because now
> what happened was that first I just pulled that branch you mentioned,
> and only noticed that "With signed tag:" notice after I had already
> pulled and was filling in the merge message.
> 
> Anyway, I redid the pull with the proper signed tag, but it was just
> annoying extra work.
> 
> And I wonder how many times I _hadn't_ noticed that, because I didn't
> have your key in my keyring either. Or maybe I caught it the first
> time.

All my previous pull requests were like that. I did the split branch/tag
beacuse the ambiguous name for branch and brings some hassle to push or
remove them. I thought a separate tag with same top commit as the branch
plus mentioning the tag in the mail would be enough to verify the pulled
branch. But apparently was not, sorry for the trouble. 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.15-rc2

2017-11-29 Thread Linus Torvalds
On Wed, Nov 29, 2017 at 11:28 AM, David Sterba  wrote:
>
> With signed tag: for-4.15-rc2-tag
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15-rc2

Oh, please actually ask me to pull the signed tag (exact same
pull-request, just point git request-pull at the tag), because now
what happened was that first I just pulled that branch you mentioned,
and only noticed that "With signed tag:" notice after I had already
pulled and was filling in the merge message.

Anyway, I redid the pull with the proper signed tag, but it was just
annoying extra work.

And I wonder how many times I _hadn't_ noticed that, because I didn't
have your key in my keyring either. Or maybe I caught it the first
time.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.15-rc2

2017-11-29 Thread David Sterba
Hi,

we've collected some fixes in since the pre-merge window freeze. There's
technically only one regression fix for 4.15, but the rest seems important and
candidates for stable. No merge conflicts, please pull, thanks.

- fix missing flush bio puts in error cases (is serious, but rarely happens)

- fix reporting stat::st_blocks for buffered append writes

- fix space cache invalidation

- fix out of bound memory access when setting zlib level

- fix potential memory corruption when fsync fails in the middle

- fix crash in integrity checker

- incremetnal send fix, path mixup for certain unlink/rename combination

- pass flags to writeback so compressed writes can be throttled properly

- error handling fixes

With signed tag: for-4.15-rc2-tag


The following changes since commit d28e649a5c58b779b303c252c66ee84a0f2c3b32:

  btrfs: Fix bug for misused dev_t when lookup in dev state hash table. 
(2017-11-01 20:45:36 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15-rc2

for you to fetch changes up to ea37d5998b50a72b9045ba60a132eeb20e1c4230:

  Btrfs: incremental send, fix wrong unlink path after renaming file 
(2017-11-28 17:15:30 +0100)


David Sterba (2):
  btrfs: add missing device::flush_bio puts
  btrfs: dev_alloc_list is not protected by RCU, use normal list_del

Filipe Manana (3):
  Btrfs: move definition of the function btrfs_find_new_delalloc_bytes
  Btrfs: fix reported number of inode blocks after buffered append writes
  Btrfs: incremental send, fix wrong unlink path after renaming file

Josef Bacik (2):
  btrfs: clear space cache inode generation always
  btrfs: fix deadlock when writing out space cache

Liu Bo (3):
  Btrfs: add write_flags for compression bio
  Btrfs: bail out gracefully rather than BUG_ON
  Btrfs: fix list_add corruption and soft lockups in fsync

Nikolay Borisov (1):
  btrfs: Fix transaction abort during failure in btrfs_rm_dev_item

Qu Wenruo (2):
  btrfs: Fix wild memory access in compression level parser
  btrfs: tree-checker: Fix false panic for sanity test

 fs/btrfs/compression.c   |   9 +--
 fs/btrfs/compression.h   |   5 +-
 fs/btrfs/ctree.h |   1 +
 fs/btrfs/disk-io.c   |  10 ++-
 fs/btrfs/extent-tree.c   |  14 ++---
 fs/btrfs/extent_io.c |   2 +-
 fs/btrfs/extent_io.h |   8 ++-
 fs/btrfs/file.c  | 130 +--
 fs/btrfs/free-space-cache.c  |   3 +-
 fs/btrfs/inode.c |  34 +++---
 fs/btrfs/relocation.c|   3 +-
 fs/btrfs/send.c  | 124 +++--
 fs/btrfs/super.c |  13 +++-
 fs/btrfs/tests/extent-io-tests.c |   6 +-
 fs/btrfs/tests/inode-tests.c |  12 ++--
 fs/btrfs/tree-checker.c  |  27 ++--
 fs/btrfs/tree-checker.h  |  14 -
 fs/btrfs/tree-log.c  |   2 +-
 fs/btrfs/volumes.c   |  32 +++---
 19 files changed, 314 insertions(+), 135 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs changes for 4.15

2017-11-14 Thread David Sterba
On Tue, Nov 14, 2017 at 07:39:11AM +0800, Qu Wenruo wrote:
> > - extend mount options to specify zlib compression level, -o compress=zlib:9
> 
> However the support for it has a big problem, it will cause wild memory
> access for "-o compress" mount option.
> 
> Kernel ASAN can detect it easily and we already have user report about
> it. Btrfs/026 could also easily trigger it.
> 
> The fixing patch is submitted some days ago:
> https://patchwork.kernel.org/patch/10042553/
> 
> And the default compression level when not specified is zero, which
> means no compression but directly memory copy.

This fix will go in next pull request. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs changes for 4.15

2017-11-13 Thread Qu Wenruo


On 2017年11月13日 23:35, David Sterba wrote:
> Hi,
> 
> please pull the following btrfs changes. There are some new user features and
> the usual load of invisible enhancements or cleanups. The branch merges
> cleanly, has been frozen in case rc7 was the last one, so I send out the pull
> request early. Thanks.
> 
> 
> New features:
> 
> - extend mount options to specify zlib compression level, -o compress=zlib:9

However the support for it has a big problem, it will cause wild memory
access for "-o compress" mount option.

Kernel ASAN can detect it easily and we already have user report about
it. Btrfs/026 could also easily trigger it.

The fixing patch is submitted some days ago:
https://patchwork.kernel.org/patch/10042553/

And the default compression level when not specified is zero, which
means no compression but directly memory copy.

Thanks,
Qu

> 
> - v2 of ioctl "extent to inode mapping", addressing a usecase where we want to
>   retrieve more but inaccurate results and do the postprocessing in userspace,
>   aiding defragmentation or deduplication tools
> 
> - populate compression heuristics logic, do data sampling and try to guess
>   compressibility by: looking for repeated patterns, counting unique byte
>   values and distribution, calculating Shannon entropy;
>   this will need more benchmarking and possibly fine tuning, but the base
>   should be good enough
> 
> - enable indexing for btrfs as lower filesystem in overlayfs
> 
> - speedup page cache readahead during send on large files
> 
> 
> Internal enhancements:
> 
> - more sanity checks of b-tree items when reading them from disk
> 
> - more EINVAL/EUCLEAN fixups, missing BLK_STS_* conversion, other errno or
>   error handling fixes
> 
> - remove some homegrown IO-related logic, that's been obsoleted by core block
>   layer changes (batching, plug/unplug, own counters)
> 
> - add ref-verify, optional debugging feature to verify extent reference
>   accounting
> 
> - simplify code handling outstanding extents, make it more clear where and how
>   the accounting is done
> 
> - make delalloc reservations per-inode, simplify the code and make the logic
>   more straightforward
> 
> - extensive cleanup of delayed refs code
> 
> 
> Notable fixes:
> 
> - fix send ioctl on 32bit with 64bit kernel
> 
> 
> The branch top commit matches the signed tag for-4.15-tag.
> 
> 
> The following changes since commit 0b07194bb55ed836c2cc7c22e866b87a14681984:
> 
>   Linux 4.14-rc7 (2017-10-29 13:58:38 -0700)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15
> 
> for you to fetch changes up to d28e649a5c58b779b303c252c66ee84a0f2c3b32:
> 
>   btrfs: Fix bug for misused dev_t when lookup in dev state hash table. 
> (2017-11-01 20:45:36 +0100)
> 
> 
> Adam Borowski (1):
>   btrfs: allow setting zlib compression level via :9
> 
> Allen Pais (1):
>   btrfs: return -ENOMEM on allocation failure in btrfsic
> 
> Anand Jain (13):
>   btrfs: declare TRACE_DEFINE_ENUM for each of show_flush_state enum
>   btrfs: copy fsid to super_block s_uuid
>   btrfs: undo writable superblocke when sprouting fails
>   btrfs: fix BUG_ON in btrfs_init_new_device()
>   btrfs: error out if btrfs_attach_transaction() fails
>   btrfs: add_missing_dev() should return the actual error
>   btrfs: fix EIO misuse to report missing degraded option
>   btrfs: declare btrfs_report_missing_device() static
>   btrfs: fix use of error or warning for missing device
>   btrfs: use BLK_STS defines where needed
>   btrfs: use need_full_stripe() in __btrfs_map_block()
>   btrfs: fix false EIO for missing device
>   btrfs: remove BUG_ON in btrfs_rm_dev_replace_free_srcdev()
> 
> Arnd Bergmann (1):
>   btrfs: tree-checker: use %zu format string for size_t
> 
> Christophe JAILLET (1):
>   btrfs: tests: Fix a memory leak in error handling path in 'run_test()'
> 
> Christos Gkekas (2):
>   btrfs: Clean up dead code in root-tree
>   btrfs: Clean up unused variables in free-space-tree.c
> 
> Colin Ian King (2):
>   btrfs: avoid null pointer dereference on fs_info when calling btrfs_crit
>   btrfs: make array types static const, reduces object code size
> 
> David Sterba (4):
>   btrfs: scrub: get rid of sector_t
>   btrfs: rename page offset parameter in submit_extent_page
>   btrfs: get rid of sector_t and use u64 offset in submit_extent_page
>   btrfs: allow to set compression level for zlib
> 
> Goldwyn Rodrigues (1):
>   btrfs: cleanup extent locking sequence
> 
> Gu JinXiang (2):
>   btrfs: Use bd_dev to generate index when dev_state_hashtable add items.
>   btrfs: Fix bug for misused dev_t when lookup in dev state hash table.
> 
> Hans van Kranenburg (1):
>   btrfs: prefix sysfs attribute struct 

[GIT PULL] Btrfs changes for 4.15

2017-11-13 Thread David Sterba
Hi,

please pull the following btrfs changes. There are some new user features and
the usual load of invisible enhancements or cleanups. The branch merges
cleanly, has been frozen in case rc7 was the last one, so I send out the pull
request early. Thanks.


New features:

- extend mount options to specify zlib compression level, -o compress=zlib:9

- v2 of ioctl "extent to inode mapping", addressing a usecase where we want to
  retrieve more but inaccurate results and do the postprocessing in userspace,
  aiding defragmentation or deduplication tools

- populate compression heuristics logic, do data sampling and try to guess
  compressibility by: looking for repeated patterns, counting unique byte
  values and distribution, calculating Shannon entropy;
  this will need more benchmarking and possibly fine tuning, but the base
  should be good enough

- enable indexing for btrfs as lower filesystem in overlayfs

- speedup page cache readahead during send on large files


Internal enhancements:

- more sanity checks of b-tree items when reading them from disk

- more EINVAL/EUCLEAN fixups, missing BLK_STS_* conversion, other errno or
  error handling fixes

- remove some homegrown IO-related logic, that's been obsoleted by core block
  layer changes (batching, plug/unplug, own counters)

- add ref-verify, optional debugging feature to verify extent reference
  accounting

- simplify code handling outstanding extents, make it more clear where and how
  the accounting is done

- make delalloc reservations per-inode, simplify the code and make the logic
  more straightforward

- extensive cleanup of delayed refs code


Notable fixes:

- fix send ioctl on 32bit with 64bit kernel


The branch top commit matches the signed tag for-4.15-tag.


The following changes since commit 0b07194bb55ed836c2cc7c22e866b87a14681984:

  Linux 4.14-rc7 (2017-10-29 13:58:38 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.15

for you to fetch changes up to d28e649a5c58b779b303c252c66ee84a0f2c3b32:

  btrfs: Fix bug for misused dev_t when lookup in dev state hash table. 
(2017-11-01 20:45:36 +0100)


Adam Borowski (1):
  btrfs: allow setting zlib compression level via :9

Allen Pais (1):
  btrfs: return -ENOMEM on allocation failure in btrfsic

Anand Jain (13):
  btrfs: declare TRACE_DEFINE_ENUM for each of show_flush_state enum
  btrfs: copy fsid to super_block s_uuid
  btrfs: undo writable superblocke when sprouting fails
  btrfs: fix BUG_ON in btrfs_init_new_device()
  btrfs: error out if btrfs_attach_transaction() fails
  btrfs: add_missing_dev() should return the actual error
  btrfs: fix EIO misuse to report missing degraded option
  btrfs: declare btrfs_report_missing_device() static
  btrfs: fix use of error or warning for missing device
  btrfs: use BLK_STS defines where needed
  btrfs: use need_full_stripe() in __btrfs_map_block()
  btrfs: fix false EIO for missing device
  btrfs: remove BUG_ON in btrfs_rm_dev_replace_free_srcdev()

Arnd Bergmann (1):
  btrfs: tree-checker: use %zu format string for size_t

Christophe JAILLET (1):
  btrfs: tests: Fix a memory leak in error handling path in 'run_test()'

Christos Gkekas (2):
  btrfs: Clean up dead code in root-tree
  btrfs: Clean up unused variables in free-space-tree.c

Colin Ian King (2):
  btrfs: avoid null pointer dereference on fs_info when calling btrfs_crit
  btrfs: make array types static const, reduces object code size

David Sterba (4):
  btrfs: scrub: get rid of sector_t
  btrfs: rename page offset parameter in submit_extent_page
  btrfs: get rid of sector_t and use u64 offset in submit_extent_page
  btrfs: allow to set compression level for zlib

Goldwyn Rodrigues (1):
  btrfs: cleanup extent locking sequence

Gu JinXiang (2):
  btrfs: Use bd_dev to generate index when dev_state_hashtable add items.
  btrfs: Fix bug for misused dev_t when lookup in dev state hash table.

Hans van Kranenburg (1):
  btrfs: prefix sysfs attribute struct names

Josef Bacik (22):
  btrfs: change how we decide to commit transactions during flushing
  btrfs: fix send ioctl on 32bit with 64bit kernel
  btrfs: add ref-verify mount option
  btrfs: pass root to various extent ref mod functions
  Btrfs: add a extent ref verify tool
  Btrfs: only check delayed ref usage in should_end_transaction
  btrfs: add a helper to return a head ref
  btrfs: move extent_op cleanup to a helper
  btrfs: breakout empty head cleanup to a helper
  btrfs: move ref_mod modification into the if (ref) logic
  btrfs: move all ref head cleanup to the helper function
  btrfs: remove delayed_ref_node from ref_head
  btrfs: remove type argument from 

Re: [GIT PULL] Btrfs fixes for 4.14-rc4

2017-10-06 Thread Liu Bo
On Fri, Oct 06, 2017 at 11:25:12PM +0100, Tomasz KÅ‚oczko wrote:
> On rc3 is possible to observe warning about possible circular locking
> dependency which I've reported on btrfs list few days ago:
>

Thanks for the report, neither this nor the one you reported on rc2
looks like a deadlock to me.

- %mmap_sem is always 'current->mm->mmap_sem',
- fsync doesn't acquire %mmap_sem, does it?

Not sure why we have a dependency here, tend to be a false one.

thanks,
-liubo

> [  101.326724] ==
> [  101.326728] WARNING: possible circular locking dependency detected
> [  101.326734] 4.14.0-0.rc3.git1.1.fc28.x86_64 #1 Not tainted
> [  101.326738] --
> [  101.326743] mysqld/1253 is trying to acquire lock:
> [  101.326747]  (>mmap_sem){}, at: []
> get_user_pages_unlocked+0x5e/0x1b0
> [  101.326771]
> [  101.326775]  (>dio_sem){}, at: []
> btrfs_direct_IO+0x39f/0x400 [btrfs]
> [  101.326846]
> [  101.326851]
> [  101.326856]
> [  101.326875]__lock_acquire+0x1107/0x11d0
> [  101.326883]lock_acquire+0xa3/0x1f0
> [  101.326892]down_write+0x51/0xc0
> [  101.326949]btrfs_log_changed_extents+0x7e/0x6c0 [btrfs]
> [  101.327000]btrfs_log_inode+0x9c1/0x11d0 [btrfs]
> [  101.327049]btrfs_log_inode_parent+0x2df/0xad0 [btrfs]
> [  101.327096]btrfs_log_dentry_safe+0x60/0x80 [btrfs]
> [  101.327144]btrfs_sync_file+0x344/0x4f0 [btrfs]
> [  101.327155]vfs_fsync_range+0x4b/0xb0
> [  101.327162]do_fsync+0x3d/0x70
> [  101.327170]SyS_fsync+0x10/0x20
> [  101.327179]do_syscall_64+0x6c/0x1f0
> [  101.327185]return_from_SYSCALL_64+0x0/0x7a
> [  101.327188]
> [  101.327204]__lock_acquire+0x1107/0x11d0
> [  101.327212]lock_acquire+0xa3/0x1f0
> [  101.327219]__mutex_lock+0x7f/0xa40
> [  101.327226]mutex_lock_nested+0x1b/0x20
> [  101.327272]btrfs_log_inode+0x159/0x11d0 [btrfs]
> [  101.327317]btrfs_log_inode_parent+0x2df/0xad0 [btrfs]
> [  101.327360]btrfs_log_dentry_safe+0x60/0x80 [btrfs]
> [  101.327407]btrfs_sync_file+0x344/0x4f0 [btrfs]
> [  101.327415]vfs_fsync_range+0x4b/0xb0
> [  101.327422]do_fsync+0x3d/0x70
> [  101.327429]SyS_fsync+0x10/0x20
> [  101.327435]do_syscall_64+0x6c/0x1f0
> [  101.327441]return_from_SYSCALL_64+0x0/0x7a
> [  101.327444]
> [  101.327463]__sb_start_write+0x12b/0x1a0
> [  101.327508]start_transaction+0x368/0x4d0 [btrfs]
> [  101.327549]btrfs_join_transaction+0x1d/0x20 [btrfs]
> [  101.327589]delayed_ref_async_start+0x67/0xd0 [btrfs]
> [  101.327637]btrfs_worker_helper+0x93/0x610 [btrfs]
> [  101.327640]
> [  101.327656]__lock_acquire+0x1107/0x11d0
> [  101.327664]lock_acquire+0xa3/0x1f0
> [  101.327671]wait_for_completion+0x62/0x1d0
> [  101.327710]btrfs_async_run_delayed_refs+0x163/0x180 [btrfs]
> [  101.327752]__btrfs_end_transaction+0x1f2/0x2e0 [btrfs]
> [  101.327790]btrfs_end_transaction+0x10/0x20 [btrfs]
> [  101.327832]btrfs_dirty_inode+0x71/0xd0 [btrfs]
> [  101.327871]btrfs_update_time+0x81/0xc0 [btrfs]
> [  101.327877]touch_atime+0xab/0xd0
> [  101.327920]btrfs_file_mmap+0x44/0x60 [btrfs]
> [  101.327927]mmap_region+0x3a3/0x5d0
> [  101.327932]do_mmap+0x2b6/0x410
> [  101.327938]vm_mmap_pgoff+0xcf/0x120
> [  101.327943]SyS_mmap_pgoff+0x1e1/0x280
> [  101.327949]SyS_mmap+0x1b/0x30
> [  101.327955]entry_SYSCALL_64_fastpath+0x1f/0xbe
> [  101.327958]
> [  101.327974]check_prev_add+0x351/0x700
> [  101.327981]__lock_acquire+0x1107/0x11d0
> [  101.327989]lock_acquire+0xa3/0x1f0
> [  101.327996]down_read+0x48/0xb0
> [  101.328003]get_user_pages_unlocked+0x5e/0x1b0
> [  101.328009]get_user_pages_fast+0x7a/0xc0
> [  101.328018]iov_iter_get_pages+0xc9/0x300
> [  101.328026]do_blockdev_direct_IO+0x192b/0x2940
> [  101.328034]__blockdev_direct_IO+0x2e/0x30
> [  101.328073]btrfs_direct_IO+0x171/0x400 [btrfs]
> [  101.328080]generic_file_direct_write+0xa3/0x160
> [  101.328123]btrfs_file_write_iter+0x2fb/0x610 [btrfs]
> [  101.328129]aio_write+0x116/0x1a0
> [  101.328134]do_io_submit+0x42d/0x940
> [  101.328139]SyS_io_submit+0x10/0x20
> [  101.328145]entry_SYSCALL_64_fastpath+0x1f/0xbe
> [  101.328149]
> [  101.328154] Chain exists of:
> [  101.328169]  Possible unsafe locking scenario:
> [  101.328174]CPU0CPU1
> [  101.328177]
> [  101.328180]   lock(>dio_sem);
> [  101.328187]lock(>log_mutex);
> [  101.328194]lock(>dio_sem);
> [  101.328200]   lock(>mmap_sem);
> [  101.328206]
> [  

Re: [GIT PULL] Btrfs fixes for 4.14-rc4

2017-10-06 Thread Tomasz KÅ‚oczko
On rc3 is possible to observe warning about possible circular locking
dependency which I've reported on btrfs list few days ago:

[  101.326724] ==
[  101.326728] WARNING: possible circular locking dependency detected
[  101.326734] 4.14.0-0.rc3.git1.1.fc28.x86_64 #1 Not tainted
[  101.326738] --
[  101.326743] mysqld/1253 is trying to acquire lock:
[  101.326747]  (>mmap_sem){}, at: []
get_user_pages_unlocked+0x5e/0x1b0
[  101.326771]
[  101.326775]  (>dio_sem){}, at: []
btrfs_direct_IO+0x39f/0x400 [btrfs]
[  101.326846]
[  101.326851]
[  101.326856]
[  101.326875]__lock_acquire+0x1107/0x11d0
[  101.326883]lock_acquire+0xa3/0x1f0
[  101.326892]down_write+0x51/0xc0
[  101.326949]btrfs_log_changed_extents+0x7e/0x6c0 [btrfs]
[  101.327000]btrfs_log_inode+0x9c1/0x11d0 [btrfs]
[  101.327049]btrfs_log_inode_parent+0x2df/0xad0 [btrfs]
[  101.327096]btrfs_log_dentry_safe+0x60/0x80 [btrfs]
[  101.327144]btrfs_sync_file+0x344/0x4f0 [btrfs]
[  101.327155]vfs_fsync_range+0x4b/0xb0
[  101.327162]do_fsync+0x3d/0x70
[  101.327170]SyS_fsync+0x10/0x20
[  101.327179]do_syscall_64+0x6c/0x1f0
[  101.327185]return_from_SYSCALL_64+0x0/0x7a
[  101.327188]
[  101.327204]__lock_acquire+0x1107/0x11d0
[  101.327212]lock_acquire+0xa3/0x1f0
[  101.327219]__mutex_lock+0x7f/0xa40
[  101.327226]mutex_lock_nested+0x1b/0x20
[  101.327272]btrfs_log_inode+0x159/0x11d0 [btrfs]
[  101.327317]btrfs_log_inode_parent+0x2df/0xad0 [btrfs]
[  101.327360]btrfs_log_dentry_safe+0x60/0x80 [btrfs]
[  101.327407]btrfs_sync_file+0x344/0x4f0 [btrfs]
[  101.327415]vfs_fsync_range+0x4b/0xb0
[  101.327422]do_fsync+0x3d/0x70
[  101.327429]SyS_fsync+0x10/0x20
[  101.327435]do_syscall_64+0x6c/0x1f0
[  101.327441]return_from_SYSCALL_64+0x0/0x7a
[  101.327444]
[  101.327463]__sb_start_write+0x12b/0x1a0
[  101.327508]start_transaction+0x368/0x4d0 [btrfs]
[  101.327549]btrfs_join_transaction+0x1d/0x20 [btrfs]
[  101.327589]delayed_ref_async_start+0x67/0xd0 [btrfs]
[  101.327637]btrfs_worker_helper+0x93/0x610 [btrfs]
[  101.327640]
[  101.327656]__lock_acquire+0x1107/0x11d0
[  101.327664]lock_acquire+0xa3/0x1f0
[  101.327671]wait_for_completion+0x62/0x1d0
[  101.327710]btrfs_async_run_delayed_refs+0x163/0x180 [btrfs]
[  101.327752]__btrfs_end_transaction+0x1f2/0x2e0 [btrfs]
[  101.327790]btrfs_end_transaction+0x10/0x20 [btrfs]
[  101.327832]btrfs_dirty_inode+0x71/0xd0 [btrfs]
[  101.327871]btrfs_update_time+0x81/0xc0 [btrfs]
[  101.327877]touch_atime+0xab/0xd0
[  101.327920]btrfs_file_mmap+0x44/0x60 [btrfs]
[  101.327927]mmap_region+0x3a3/0x5d0
[  101.327932]do_mmap+0x2b6/0x410
[  101.327938]vm_mmap_pgoff+0xcf/0x120
[  101.327943]SyS_mmap_pgoff+0x1e1/0x280
[  101.327949]SyS_mmap+0x1b/0x30
[  101.327955]entry_SYSCALL_64_fastpath+0x1f/0xbe
[  101.327958]
[  101.327974]check_prev_add+0x351/0x700
[  101.327981]__lock_acquire+0x1107/0x11d0
[  101.327989]lock_acquire+0xa3/0x1f0
[  101.327996]down_read+0x48/0xb0
[  101.328003]get_user_pages_unlocked+0x5e/0x1b0
[  101.328009]get_user_pages_fast+0x7a/0xc0
[  101.328018]iov_iter_get_pages+0xc9/0x300
[  101.328026]do_blockdev_direct_IO+0x192b/0x2940
[  101.328034]__blockdev_direct_IO+0x2e/0x30
[  101.328073]btrfs_direct_IO+0x171/0x400 [btrfs]
[  101.328080]generic_file_direct_write+0xa3/0x160
[  101.328123]btrfs_file_write_iter+0x2fb/0x610 [btrfs]
[  101.328129]aio_write+0x116/0x1a0
[  101.328134]do_io_submit+0x42d/0x940
[  101.328139]SyS_io_submit+0x10/0x20
[  101.328145]entry_SYSCALL_64_fastpath+0x1f/0xbe
[  101.328149]
[  101.328154] Chain exists of:
[  101.328169]  Possible unsafe locking scenario:
[  101.328174]CPU0CPU1
[  101.328177]
[  101.328180]   lock(>dio_sem);
[  101.328187]lock(>log_mutex);
[  101.328194]lock(>dio_sem);
[  101.328200]   lock(>mmap_sem);
[  101.328206]
[  101.328213] 2 locks held by mysqld/1253:
[  101.328217]  #0:  (sb_writers#10){.+.+}, at: []
aio_write+0x191/0x1a0
[  101.328231]  #1:  (>dio_sem){}, at: []
btrfs_direct_IO+0x39f/0x400 [btrfs]
[  101.328277]
[  101.328285] CPU: 0 PID: 1253 Comm: mysqld Not tainted
4.14.0-0.rc3.git1.1.fc28.x86_64 #1
[  101.328290] Hardware name: Sony Corporation VPCSB2M9E/VAIO, BIOS
R2087H4 06/15/2012
[  101.328294] Call Trace:
[  101.328304]  dump_stack+0x8e/0xd6
[  101.328314]  print_circular_bug+0x1f6/0x2e0
[  101.328322]  ? 

[GIT PULL] Btrfs fixes for 4.14-rc4

2017-10-06 Thread David Sterba
Hi,

we have two more fixes for bugs introduced in 4.13. The sector_t problem with
32bit architecture and !LBDAF config seems serious but the number of affected
deployments is hopefully low.  The clashing status bits could lead to a
confusing in-memory state of the whole-filesystem operations if used with the
quota override sysfs knob.

Please pull, thanks.

The following changes since commit 8c6c592831a09a28428448e68fb08c6bbb8b9b8b:

  btrfs: log csums for all modified extents (2017-09-26 14:54:16 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.14-rc4

for you to fetch changes up to 69ad59767d094752c23c0fc180a79532fde073d0:

  Btrfs: fix overlap of fs_info::flags values (2017-10-04 16:44:18 +0200)


Goffredo Baroncelli (1):
  btrfs: avoid overflow when sector_t is 32 bit

Tsutomu Itoh (1):
  Btrfs: fix overlap of fs_info::flags values

 fs/btrfs/ctree.h | 2 +-
 fs/btrfs/extent_io.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.14-rc3

2017-09-29 Thread David Sterba
Hi,

we've collected a bunch of isolated fixes, for crashes, user-visible behaviour
or missing bits from other subsystem cleanups from the past.  The overall
number is not small but I was not able to make it significantly smaller. Most
of the patches are supposed to go to stable. There are no merge conflicts.
Please pull, thanks.

The following changes since commit db95c876c568cef951fbbd4c0118cb5386e4bb99:

  btrfs: submit superblock io with REQ_META and REQ_PRIO (2017-08-22 13:22:05 
+0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.14-rc3

for you to fetch changes up to 8c6c592831a09a28428448e68fb08c6bbb8b9b8b:

  btrfs: log csums for all modified extents (2017-09-26 14:54:16 +0200)


Josef Bacik (1):
  btrfs: log csums for all modified extents

Liu Bo (7):
  Btrfs: use the new helper wbc_to_write_flags
  Btrfs: do not reset bio->bi_ops while writing bio
  Btrfs: do not backup tree roots when fsync
  Btrfs: use btrfs_op instead of bio_op in __btrfs_map_block
  Btrfs: fix kernel oops while reading compressed data
  Btrfs: skip checksum when reading compressed data if some IO have failed
  Btrfs: fix unexpected result when dio reading corrupted blocks

Misono, Tomohiro (1):
  btrfs: remove BTRFS_FS_QUOTA_DISABLING flag

Naohiro Aota (4):
  btrfs: clear ordered flag on cleaning up ordered extents
  btrfs: finish ordered extent cleaning if no progress is found
  btrfs: fix NULL pointer dereference from free_reloc_roots()
  btrfs: propagate error to btrfs_cmp_data_prepare caller

Omar Sandoval (1):
  Btrfs: fix incorrect {node,sector}size endianness from BTRFS_IOC_FS_INFO

Sargun Dhillon (1):
  btrfs: Report error on removing qgroup if del_qgroup_item fails

Tsutomu Itoh (1):
  Btrfs: send: fix error number for unknown inode types

satoru takeuchi (1):
  btrfs: prevent to set invalid default subvolid

 fs/btrfs/compression.c | 18 +-
 fs/btrfs/ctree.h   |  1 -
 fs/btrfs/disk-io.c |  9 -
 fs/btrfs/extent_io.c   |  8 ++--
 fs/btrfs/inode.c   | 27 ++-
 fs/btrfs/ioctl.c   | 12 
 fs/btrfs/qgroup.c  |  6 ++
 fs/btrfs/relocation.c  |  2 +-
 fs/btrfs/send.c|  2 +-
 fs/btrfs/tree-log.c| 12 ++--
 fs/btrfs/volumes.c |  2 +-
 11 files changed, 72 insertions(+), 27 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs for 4.14

2017-09-08 Thread David Sterba
Hi,

please pull the following btrfs branch to 4.14. The changes range through all
types: cleanups, core chagnes, sanity checks, fixes, other user visible
changes, detailed list below.

Merging notes: there's a minor conflict with the blk_status_t fix that went to
4.13-rc7 while this pull is on top of 4.13-rc5 as I did not want to rebase. The
resolution is simple, there's a removed parameter 'skip_sum' in function
__btrfs_submit_dio_bio. My resolution can be found in branch for-4.14-merged.

Changes:
* deprecated: user transaction ioctl
* mount option ssd does not change allocation alignments
* degraded read-write mount is allowed if all the raid profile constraints are
  met, now based on more accurate check
* defrag: do not reset compression afterwards; the NOCOMPRESS flag can be now
  overriden by defrag
* prep work for better extent reference tracking (related to the qgroup
  slowness with balance)
* prep work for compression heuristics
* memory allocation reductions (may help latencies on a loaded system)
* better accounting for io waiting states
* error handling improvements (removed BUGs)
* added more sanity checks for shared refs
* fix readdir vs pagefault deadlock under some circumstances
* fix for 'no-hole' mode, certain combination of compressed and inline extents
* send: fix emission of invalid clone operations
* fixup file mode if setting acls fail
* more fixes from fuzzing
* oher cleanups

The following changes since commit ef954844c7ace62f773f4f23e28d2d915adc419f:

  Linux 4.13-rc5 (2017-08-13 16:01:32 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.14

for you to fetch changes up to db95c876c568cef951fbbd4c0118cb5386e4bb99:

  btrfs: submit superblock io with REQ_META and REQ_PRIO (2017-08-22 13:22:05 
+0200)


Aleksa Sarai (1):
  btrfs: resume qgroup rescan on rw remount

Anand Jain (4):
  btrfs: btrfs_inherit_iflags() can be static
  btrfs: use appropriate define for the fsid
  btrfs: use BTRFS_FSID_SIZE for fsid
  btrfs: remove unused BTRFS_COMPRESS_LAST

Colin Ian King (1):
  btrfs: remove redundant check on ret being non-zero

David Sterba (30):
  btrfs: drop newlines from strings when using btrfs_* helpers
  btrfs: use GFP_KERNEL in mount and remount
  btrfs: use GFP_KERNEL in btrfs_defrag_file
  btrfs: defrag: make readahead state allocation failure non-fatal
  btrfs: factor reading progress out of btrfs_dev_replace_status
  btrfs: simplify btrfs_dev_replace_kthread
  btrfs: get fs_info from eb in btrfs_print_leaf, remove argument
  btrfs: get fs_info from eb in btrfs_print_tree, remove argument
  btrfs: cleanup types storing REQ_*
  btrfs: merge REQ_OP and REQ_ flags to one parameter in submit_extent_page
  btrfs: merge alloc_device helpers
  btrfs: refactor find_device helper
  btrfs: split write_dev_supers to two functions
  btrfs: use named constant for bdev blocksize
  btrfs: fix spelling of snapshotting
  btrfs: drop ancient page flag mappings
  btrfs: remove trivial wrapper btrfs_force_ra
  btrfs: drop chunk locks at the end of close_ctree
  btrfs: account that we're waiting for DIO read
  btrfs: account that we're waiting for IO in scrub_submit_raid56_bio_wait
  btrfs: rename variable holding per-inode compression type
  btrfs: separate defrag and property compression
  btrfs: defrag: cleanup checking for compression status
  btrfs: allow defrag compress to override NOCOMPRESS attribute
  btrfs: prepare for extensions in compression options
  btrfs: scrub: use bool for flush_all_writes
  btrfs: scrub: clean up division in __scrub_mark_bitmap
  btrfs: scrub: clean up division in scrub_find_csum
  btrfs: scrub: simplify scrub worker initialization
  btrfs: submit superblock io with REQ_META and REQ_PRIO

Edmund Nadolski (6):
  btrfs: btrfs_check_shared should manage its own transaction
  btrfs: remove ref_tree implementation from backref.c
  btrfs: convert prelimary reference tracking to use rbtrees
  btrfs: add cond_resched() calls when resolving backrefs
  btrfs: allow backref search checks for shared extents
  btrfs: clean up extraneous computations in add_delayed_refs

Ernesto A. Fernández (1):
  btrfs: preserve i_mode if __btrfs_set_acl() fails

Filipe Manana (3):
  Btrfs: avoid unnecessarily locking inode when clearing a range
  Btrfs: fix assertion failure during fsync in no-holes mode
  Btrfs: incremental send, fix emission of invalid clone operations

Hans van Kranenburg (1):
  btrfs: Do not use data_alloc_cluster in ssd mode

Jeff Mahoney (9):
  btrfs: struct-funcs, constify readers
  btrfs: constify tracepoint arguments
  btrfs: backref, constify some arguments
  btrfs: backref, add unode_aux_to_inode_list helper
  btrfs: 

[GIT PULL] Btrfs fix for rc7

2017-08-24 Thread David Sterba
Hi,

we have one more fixup that stems from the blk_status_t conversion that did not
quite cover everything. The normal cases were not affected because the code is
0, but any error and retries could mix up new and old values. Please pull, 
thanks.


The following changes since commit 14ccee78fc82f5512908f4424f541549a5705b89:

  Linux 4.13-rc6 (2017-08-20 14:13:52 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.13-rc7

for you to fetch changes up to 58efbc9f5463308c43d812fd0748a4dee44c8a16:

  Btrfs: fix blk_status_t/errno confusion (2017-08-24 17:19:02 +0200)


Omar Sandoval (1):
  Btrfs: fix blk_status_t/errno confusion

 fs/btrfs/disk-io.c |  4 ++--
 fs/btrfs/inode.c   | 70 +-
 fs/btrfs/raid56.c  | 34 +-
 fs/btrfs/volumes.c | 10 
 fs/btrfs/volumes.h |  6 ++---
 5 files changed, 64 insertions(+), 60 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.13-rc3

2017-07-28 Thread David Sterba
Hi,

please pull the following btrfs fixes. They're addressing problems reported by
users, and there's one more regression fix. Thanks.

The next pull request will be sent by Chris, I'm heading off to vacation.


The following changes since commit c3cfb656307583ddfea45375c10183737593c195:

  Btrfs: fix unexpected return value of bio_readpage_error (2017-07-14 20:42:37 
+0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.13-part3

for you to fetch changes up to 0e4324a4c36b3eb5cd1f71cbbc38d888f919ebfc:

  btrfs: round down size diff when shrinking/growing device (2017-07-24 
16:05:00 +0200)


Filipe Manana (1):
  Btrfs: fix dir item validation when replaying xattr deletes

Jeff Mahoney (1):
  btrfs: fix lockup in find_free_extent with read-only block groups

Nikolay Borisov (1):
  btrfs: round down size diff when shrinking/growing device

Omar Sandoval (1):
  Btrfs: fix early ENOSPC due to delalloc

 fs/btrfs/extent-tree.c | 11 +--
 fs/btrfs/tree-log.c|  3 +--
 fs/btrfs/volumes.c |  4 ++--
 3 files changed, 8 insertions(+), 10 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs for 4.13, part 2

2017-07-14 Thread David Sterba
Hi,

we've identified and fixed a silent corruption (introduced by code in the
first pull), a fixup after the blk_status_t merge and two fixes to incremental
send that Filipe has been hunting for some time. Please pull, thanks.


The following changes since commit 848c23b78fafdcd3270b06a30737f8dbd70c347f:

  btrfs: Remove false alert when fiemap range is smaller than on-disk extent 
(2017-06-29 20:25:20 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.13-part2

for you to fetch changes up to c3cfb656307583ddfea45375c10183737593c195:

  Btrfs: fix unexpected return value of bio_readpage_error (2017-07-14 20:42:37 
+0200)


David Sterba (3):
  Merge branch 'next/filipe' into for-4.13-part2
  btrfs: cloned bios must not be iterated by bio_for_each_segment_all
  btrfs: btrfs_create_repair_bio never fails, skip error handling

Filipe Manana (3):
  Btrfs: incremental send, fix invalid path for link commands
  Btrfs: incremental send, fix invalid memory access
  Btrfs: fix write corruption due to bio cloning on raid5/6

Liu Bo (1):
  Btrfs: fix unexpected return value of bio_readpage_error

 fs/btrfs/compression.c |  1 +
 fs/btrfs/disk-io.c |  1 +
 fs/btrfs/extent_io.c   | 19 ++-
 fs/btrfs/extent_io.h   |  4 +--
 fs/btrfs/inode.c   |  6 ++--
 fs/btrfs/raid56.c  | 26 ++-
 fs/btrfs/send.c| 88 +++---
 7 files changed, 88 insertions(+), 57 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs for 4.13

2017-07-05 Thread Christoph Hellwig
On Wed, Jul 05, 2017 at 04:45:49PM -0700, Linus Torvalds wrote:
> Ouch, yeah, that was annoying. And yes, I ended up with several
> whitespace differences but other than that it looks the same. Oh well.
> 
> Jens, Christoph, let's not do that stupid thing with status-vs-error
> ever again, ok?

It should be done now :)

Back to serious - this work had to be done as we could not communicate
errors properly in the block layer with people inventing their own
codes all the time.  That being said, in retrospective I should have
tried a gradual approach that first defines the new code to the old
errors and left the fields in place.  I opted for the hard break to
make sure we can catch matching conversions by the compiler as very
few people run sparse for the __bitwise annotations, and some of
the drivers create so many sparse warnings that they would be lost
anyway.

But I've learned and will try to make something like this gradual
if it comes up, and hope we won't have to do something like it again
at all.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs for 4.13

2017-07-05 Thread Linus Torvalds
On Tue, Jul 4, 2017 at 8:19 AM, David Sterba  wrote:
>
> There are conflicts with the recently merged block layer branch, the
> resolutions are a bit tedious but still straightforward. Stephen sent a mail
> about that [1]. You can find my merge at for-4.13-part1-merged, there might be
> some whitespace formatting differences but the result is the same.

Ouch, yeah, that was annoying. And yes, I ended up with several
whitespace differences but other than that it looks the same. Oh well.

Jens, Christoph, let's not do that stupid thing with status-vs-error
ever again, ok?

   Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs for 4.13

2017-07-04 Thread David Sterba
Hi,

please pull the following btrfs changes. As agreed, the pull request comes from
me because Chris is on vacation.  The changelog is below.

There are conflicts with the recently merged block layer branch, the
resolutions are a bit tedious but still straightforward. Stephen sent a mail
about that [1]. You can find my merge at for-4.13-part1-merged, there might be
some whitespace formatting differences but the result is the same.

[1] https://marc.info/?l=linux-kernel=149912551326791=2

Changes:

The core updates improve error handling (mostly related to bios), with the
usual incremental work on the GFP_NOFS (mis)use removal, refactoring or
cleanups.  Except the two top patches, all have been in for-next for an
extensive amount of time.

User visible changes:
* statx support
* quota override tunable
* improved compression thresholds
* obsoleted mount option alloc_start

Core updates:
* bio-related updates
  - faster bio cloning
  - no allocation failures
  - preallocated flush bios
* more kvzalloc use, memalloc_nofs protections, GFP_NOFS updates
* prep work for btree_inode removal
* dir-item validation
* qgoup fixes and updates
* cleanups
  - removed unused struct members, unused code, refactoring
  - argument refactoring (fs_info/root, caller -> callee sink)
  - SEARCH_TREE ioctl docs


The following changes since commit 41f1830f5a7af77cf5c86359aba3cbd706687e52:

  Linux 4.12-rc6 (2017-06-19 22:19:37 +0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.13-part1

for you to fetch changes up to 848c23b78fafdcd3270b06a30737f8dbd70c347f:

  btrfs: Remove false alert when fiemap range is smaller than on-disk extent 
(2017-06-29 20:25:20 +0200)


Anand Jain (7):
  btrfs: cleanup unused qgroup trace event
  btrfs: add framework to handle device flush error as a volume
  btrfs: btrfs_decompress_bio() could accept compressed_bio instead
  btrfs: reduce arguments for decompress_bio ops
  btrfs: write_dev_flush does not return ENOMEM anymore
  btrfs: remove redundant null bdev counting during flush submission
  btrfs: wait part of the write_dev_flush() can be separated out

Arnd Bergmann (1):
  Btrfs: work around maybe-uninitialized warning

Chris Mason (1):
  btrfs: fix integer overflow in calc_reclaim_items_nr

Daichou (1):
  Btrfs: remove obsolete FIXMEs in qgroup ioctls

Dan Carpenter (1):
  Btrfs: remove an unused variable

David Sterba (40):
  btrfs: remove unused member err from reada_extent
  btrfs: remove unused member list from async_submit_bio
  btrfs: remove unused members dir_path from recorded_ref
  btrfs: remove unused member list from btrfs_end_io_wq
  btrfs: fix bool type in btrfs_page_exists_in_range
  btrfs: scrub: inline helper scrub_setup_wr_ctx
  btrfs: scrub: inline helper scrub_free_wr_ctx
  btrfs: scrub: simplify cleanup of wr_ctx in scrub_free_ctx
  btrfs: scrub: use fs_info::sectorsize and drop it from scrub context
  btrfs: scrub: embed scrub_wr_ctx into scrub context
  btrfs: use generic slab for for btrfs_transaction
  btrfs: replace opencoded kvzalloc with the helper
  btrfs: send: use kvmalloc in iterate_dir_item
  btrfs: scrub: add memalloc_nofs protection around init_ipath
  btrfs: use GFP_KERNEL in init_ipath
  btrfs: adjust includes after vmalloc removal
  btrfs: add memalloc_nofs protections around alloc_workspace callback
  btrfs: switch kmallocs to GFP_KERNEL in lzo/zlib alloc_workspace
  btrfs: switch to kvmalloc and GFP_KERNEL in lzo/zlib alloc_workspace
  btrfs: bioset allocations will never fail, adapt our helpers
  btrfs: btrfs_bio_alloc never fails, skip error handling
  btrfs: btrfs_bio_clone never fails, skip error handling
  btrfs: btrfs_io_bio_alloc never fails, skip error handling
  btrfs: sink gfp parameter to btrfs_bio_clone
  btrfs: remove redundant parameters from btrfs_bio_alloc
  btrfs: opencode trivial compressed_bio_alloc, simplify error handling
  btrfs: pass bytes to btrfs_bio_alloc
  btrfs: document mandatory order of bio in btrfs_io_bio
  btrfs: add helper to initialize the non-bio part of btrfs_io_bio
  btrfs: sink gfp parameter to btrfs_io_bio_alloc
  btrfs: use GFP_KERNEL in btrfs_calc_avail_data_space
  btrfs: use GFP_KERNEL in btrfs_init_dev_replace_tgtdev
  btrfs: cleanup duplicate return value in insert_inline_extent
  btrfs: move fs_info::fs_frozen to the flags
  btrfs: obsolete and remove mount option alloc_start
  btrfs: preallocate device flush bio
  btrfs: account as waiting for IO, while waiting fot the flush bio 
completion
  btrfs: move dev stats accounting out of wait_dev_flush
  btrfs: fix validation of XATTR_ITEM dir items
  btrfs: scrub: fix 

[GIT PULL] Btrfs

2017-06-10 Thread Chris Mason
Hi Linus,

My for-linus-4.12 branch has some fixes that Dave Sterba collected:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.12

We've been hitting an early enospc problem on production machines that
Omar tracked down to an old int->u64 mistake.  I waited a bit on
this pull to make sure it was really the problem from production,
but it's on ~2100 hosts now and I think we're good.

Omar also noticed a commit in the queue would make new early ENOSPC
problems.  I pulled that out for now, which is why the top three commits
are younger than the rest.

Otherwise these are all fixes, some explaining very old bugs that we've
been poking at for a while.

Jeff Mahoney (2) commits (+4/-3):
btrfs: fix race with relocation recovery and fs_root setup (+3/-3)
btrfs: fix memory leak in update_space_info failure path (+1/-0)

Liu Bo (1) commits (+1/-1):
Btrfs: clear EXTENT_DEFRAG bits in finish_ordered_io

Colin Ian King (1) commits (+1/-1):
btrfs: fix incorrect error return ret being passed to mapping_set_error

Omar Sandoval (1) commits (+2/-2):
Btrfs: fix delalloc accounting leak caused by u32 overflow

Qu Wenruo (1) commits (+122/-2):
btrfs: fiemap: Cache and merge fiemap extent before submit it to user

David Sterba (1) commits (+2/-2):
btrfs: use correct types for page indices in btrfs_page_exists_in_range

Jan Kara (1) commits (+6/-4):
btrfs: Make flush bios explicitely sync

Su Yue (1) commits (+1/-1):
btrfs: tree-log.c: Wrong printk information about namelen

Total: (9) commits (+139/-16)

 fs/btrfs/ctree.h   |   4 +-
 fs/btrfs/dir-item.c|   2 +-
 fs/btrfs/disk-io.c |  10 ++--
 fs/btrfs/extent-tree.c |   7 +--
 fs/btrfs/extent_io.c   | 126 +++--
 fs/btrfs/inode.c   |   6 +--
 6 files changed, 139 insertions(+), 16 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs

2017-05-09 Thread Chris Mason
On 05/09/2017 01:56 PM, Chris Mason wrote:
> Hi Linus,
> 
> My for-linus-4.12 branch:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
> for-linus-4.12

I hit send too soon, sorry.  There's a trivial conflict with our WARN_ON
fix that went into 4.11.  I pushed the resolution to
for-linus-4.12-merged.

diff --cc fs/btrfs/qgroup.c
index afbea61,3f75b5c..deffbeb
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@@ -1078,7 -1031,8 +1034,8 @@@ static int __qgroup_excl_accounting(str
qgroup->excl += sign * num_bytes;
qgroup->excl_cmpr += sign * num_bytes;
if (sign > 0) {
+   trace_qgroup_update_reserve(fs_info, qgroup, -(s64)num_bytes);
 -  if (WARN_ON(qgroup->reserved < num_bytes))
 +  if (qgroup->reserved < num_bytes)
report_reserved_underflow(fs_info, qgroup, num_bytes);
else
qgroup->reserved -= num_bytes;
@@@ -1103,7 -1057,9 +1060,9 @@@
WARN_ON(sign < 0 && qgroup->excl < num_bytes);
qgroup->excl += sign * num_bytes;
if (sign > 0) {
+   trace_qgroup_update_reserve(fs_info, qgroup,
+   -(s64)num_bytes);
 -  if (WARN_ON(qgroup->reserved < num_bytes))
 +  if (qgroup->reserved < num_bytes)
report_reserved_underflow(fs_info, qgroup,
  num_bytes);
else
@@@ -2472,7 -2451,8 +2454,8 @@@ void btrfs_qgroup_free_refroot(struct b
  
qg = unode_aux_to_qgroup(unode);
  
+   trace_qgroup_update_reserve(fs_info, qg, -(s64)num_bytes);
 -  if (WARN_ON(qg->reserved < num_bytes))
 +  if (qg->reserved < num_bytes)
report_reserved_underflow(fs_info, qg, num_bytes);
else
qg->reserved -= num_bytes;
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2017-05-09 Thread Chris Mason
Hi Linus,

My for-linus-4.12 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.12

Has fixes and cleanups Dave Sterba collected for the merge window.

The biggest functional fixes are between btrfs raid5/6 and scrub, and
raid5/6 and device replacement.  Some of our pending qgroup fixes are
included as well while I bash on the rest in testing.

We also have the usual set of cleanups, including one that
__btrfs_map_block() much more maintainable, and conversions from
atomic_t to refcount_t.

Elena Reshetova (16) commits (+141/-135):
btrfs: convert btrfs_delayed_ref_node.refs from atomic_t to refcount_t 
(+14/-12)
btrfs: convert btrfs_transaction.use_count from atomic_t to refcount_t 
(+16/-14)
btrfs: convert compressed_bio.pending_bios from atomic_t to refcount_t 
(+9/-9)
btrfs: convert btrfs_caching_control.count from atomic_t to refcount_t 
(+8/-7)
btrfs: convert btrfs_ordered_extent.refs from atomic_t to refcount_t 
(+11/-11)
btrfs: convert btrfs_delayed_item.refs from atomic_t to refcount_t (+10/-10)
btrfs: convert btrfs_delayed_node.refs from atomic_t to refcount_t (+16/-16)
btrfs: convert btrfs_raid_bio.refs from atomic_t to refcount_t (+9/-10)
btrfs: convert scrub_recover.refs from atomic_t to refcount_t (+4/-4)
btrfs: convert scrub_parity.refs from atomic_t to refcount_t (+4/-4)
btrfs: convert extent_state.refs from atomic_t to refcount_t (+9/-8)
btrfs: convert extent_map.refs from atomic_t to refcount_t (+12/-11)
btrfs: convert scrub_block.refs from atomic_t to refcount_t (+5/-5)
btrfs: convert btrfs_root.refs from atomic_t to refcount_t (+4/-4)
btrfs: convert scrub_ctx.refs from atomic_t to refcount_t (+5/-5)
btrfs: convert btrfs_bio.refs from atomic_t to refcount_t (+5/-5)

Liu Bo (15) commits (+640/-425):
Btrfs: do not add extra mirror when dev_replace target dev is not available 
(+4/-3)
Btrfs: introduce a function to get extra mirror from replace (+89/-72)
Btrfs: fix wrong failed mirror_num of read-repair on raid56 (+5/-0)
Btrfs: set scrub page's io_error if failing to submit io (+6/-2)
Btrfs: handle operations for device replace separately (+98/-81)
Btrfs: enable repair during read for raid56 profile (+27/-13)
Btrfs: separate DISCARD from __btrfs_map_block (+175/-114)
Btrfs: remove ASSERT in btrfs_truncate_inode_items (+0/-7)
Btrfs: switch to div64_u64 if with a u64 divisor (+7/-7)
Btrfs: update scrub_parity to use u64 stripe_len (+4/-4)
Btrfs: helper for ops that requires full stripe (+10/-8)
Btrfs: create a helper for getting chunk map (+57/-111)
Btrfs: update comments in cache_save_setup (+2/-1)
Btrfs: add file item tracepoints (+154/-0)
Btrfs: convert BUG_ON to WARN_ON (+2/-2)

David Sterba (12) commits (+72/-86):
btrfs: remove redundant parameter from reada_start_machine_dev (+3/-4)
btrfs: remove unused qgroup members from btrfs_trans_handle (+0/-20)
btrfs: preallocate radix tree node for global readahead tree (+8/-1)
btrfs: sink GFP flags parameter to tree_mod_log_insert_root (+5/-5)
btrfs: sink GFP flags parameter to tree_mod_log_insert_move (+5/-5)
btrfs: remove local blocksize variable in reada_find_extent (+2/-4)
btrfs: remove redundant parameter from btree_readahead_hook (+5/-6)
btrfs: drop redundant parameters from btrfs_map_sblock (+6/-9)
btrfs: track exclusive filesystem operation in flags (+25/-26)
btrfs: remove redundant parameter from reada_find_zone (+3/-3)
btrfs: preallocate radix tree node for readahead (+8/-1)
btrfs: use clear_page where appropriate (+2/-2)

Qu Wenruo (10) commits (+510/-96):
btrfs: qgroup: Re-arrange tracepoint timing to co-operate with reserved 
space tracepoint (+6/-10)
btrfs: qgroup: Fix qgroup corruption caused by inode_cache mount option 
(+18/-7)
btrfs: Wait for in-flight bios before freeing target device for raid56 
(+21/-0)
btrfs: Fix metadata underflow caused by btrfs_reloc_clone_csum error 
(+39/-12)
btrfs: Handle delalloc error correctly to avoid ordered extent hang 
(+48/-15)
btrfs: qgroup: Add trace point for qgroup reserved space (+96/-44)
btrfs: Prevent scrub recheck from racing with dev replace (+9/-4)
btrfs: scrub: Don't append on-disk pages for raid56 scrub (+0/-4)
btrfs: scrub: Introduce full stripe lock for RAID56 (+251/-0)
btrfs: scrub: Fix RAID56 recovery race condition (+22/-0)

Filipe Manana (5) commits (+192/-41):
Btrfs: fix incorrect space accounting after failure to insert inline extent 
(+4/-2)
Btrfs: fix invalid attempt to free reserved space on failure to cow range 
(+45/-18)
Btrfs: send, fix file hole not being preserved due to inline extent (+21/-2)
Btrfs: fix extent map leak during fallocate error path (+3/-1)
Btrfs: fix reported number of inode blocks (+119/-18)

Anand Jain (3) commits (+7/-8):
btrfs: use q which is already obtained from 

[GIT PULL] Btrfs

2017-04-27 Thread Chris Mason

Hi Linus,

We have one more for btrfs:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.11

This is dropping a new WARN_ON from rc1 that ended up making more noise 
than we really want.  The larger fix for the underflow got delayed a bit 
and it's better for now to put it under CONFIG_BTRFS_DEBUG.


David Sterba (1) commits (+7/-4):
   btrfs: qgroup: move noisy underflow warning to debugging build

Total: (1) commits (+7/-4)

fs/btrfs/qgroup.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs bug fixes for 4.12

2017-04-26 Thread Chris Mason

On 04/26/2017 01:52 PM, fdman...@kernel.org wrote:

From: Filipe Manana 

Hi Chris,

Please consider the following changes for the 4.12 merge window.
These are all bug fixes and nothing particularly outstanding compared to
changes for past merge windows.

Thanks.

The following changes since commit a967efb30b3afa3d858edd6a17f544f9e9e46eea:

  Btrfs: fix potential use-after-free for cloned bio (2017-04-11 18:49:56 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
for-chris-4.12

for you to fetch changes up to a7e3b975a0f9296162b72ac6ab7fad9631a07630:

  Btrfs: fix reported number of inode blocks (2017-04-26 16:27:26 +0100)


Filipe Manana (5):
  Btrfs: fix invalid attempt to free reserved space on failure to cow range
  Btrfs: fix incorrect space accounting after failure to insert inline 
extent
  Btrfs: fix extent map leak during fallocate error path
  Btrfs: send, fix file hole not being preserved due to inline extent
  Btrfs: fix reported number of inode blocks

Qu Wenruo (2):
  btrfs: Fix metadata underflow caused by btrfs_reloc_clone_csum error
  btrfs: Handle delalloc error correctly to avoid ordered extent hang


Thanks Filipe, pulling this in.

-chris

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs bug fixes for 4.12

2017-04-26 Thread fdmanana
From: Filipe Manana 

Hi Chris,

Please consider the following changes for the 4.12 merge window.
These are all bug fixes and nothing particularly outstanding compared to
changes for past merge windows.

Thanks.

The following changes since commit a967efb30b3afa3d858edd6a17f544f9e9e46eea:

  Btrfs: fix potential use-after-free for cloned bio (2017-04-11 18:49:56 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
for-chris-4.12

for you to fetch changes up to a7e3b975a0f9296162b72ac6ab7fad9631a07630:

  Btrfs: fix reported number of inode blocks (2017-04-26 16:27:26 +0100)


Filipe Manana (5):
  Btrfs: fix invalid attempt to free reserved space on failure to cow range
  Btrfs: fix incorrect space accounting after failure to insert inline 
extent
  Btrfs: fix extent map leak during fallocate error path
  Btrfs: send, fix file hole not being preserved due to inline extent
  Btrfs: fix reported number of inode blocks

Qu Wenruo (2):
  btrfs: Fix metadata underflow caused by btrfs_reloc_clone_csum error
  btrfs: Handle delalloc error correctly to avoid ordered extent hang

 fs/btrfs/btrfs_inode.h |   7 
 fs/btrfs/extent_io.h   |   5 ++-
 fs/btrfs/file.c|  66 +
 fs/btrfs/inode.c   | 242 
+++
 fs/btrfs/send.c|  23 +++--
 5 files changed, 277 insertions(+), 66 deletions(-)

-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2017-04-14 Thread Chris Mason

Hi Linus

Dave Sterba collected a few more fixes for the last rc:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.11

These aren't marked for stable, but I'm putting them in with a batch 
were testing/sending by hand for this release.


Liu Bo (3) commits (+11/-13):
   Btrfs: fix invalid dereference in btrfs_retry_endio (+4/-10)
   Btrfs: fix potential use-after-free for cloned bio (+1/-1)
   Btrfs: fix segmentation fault when doing dio read (+6/-2)

Adam Borowski (1) commits (+3/-0):
   btrfs: drop the nossd flag when remounting with -o ssd

Total: (4) commits (+14/-13)

fs/btrfs/inode.c   | 22 ++
fs/btrfs/super.c   |  3 +++
fs/btrfs/volumes.c |  2 +-
3 files changed, 14 insertions(+), 13 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2017-03-31 Thread Chris Mason
Hi Linus,

We have 3 small fixes queued up in my for-linus-4.11 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.11

Goldwyn Rodrigues (1) commits (+7/-7):
btrfs: Change qgroup_meta_rsv to 64bit

Dan Carpenter (1) commits (+6/-1):
Btrfs: fix an integer overflow check

Liu Bo (1) commits (+31/-21):
Btrfs: bring back repair during read

Total: (3) commits (+44/-29)

 fs/btrfs/ctree.h |  2 +-
 fs/btrfs/disk-io.c   |  2 +-
 fs/btrfs/extent_io.c | 46 --
 fs/btrfs/inode.c |  6 +++---
 fs/btrfs/qgroup.c| 10 +-
 fs/btrfs/send.c  |  7 ++-
 6 files changed, 44 insertions(+), 29 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2017-03-23 Thread Chris Mason

Hi Linus

We have a small set of fixes for the next RC:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.11

Zygo tracked down a very old bug with inline compressed extents.
I didn't tag this one for stable because I want to do individual tested 
backports.  It's a little tricky and I'd rather do some extra testing

on it along the way.

Otherwise they are pretty obvious:

Liu Bo (1) commits (+2/-1):
   Btrfs: fix regression in lock_delalloc_pages

Dmitry V. Levin (1) commits (+0/-27):
   btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

Zygo Blaxell (1) commits (+14/-0):
   btrfs: add missing memset while reading compressed inline extents

Total: (3) commits (+16/-28)

fs/btrfs/extent_io.c   |  3 ++-
fs/btrfs/inode.c   | 14 ++
include/uapi/linux/btrfs.h | 27 ---
3 files changed, 16 insertions(+), 28 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2017-03-02 Thread Chris Mason
Hi Linus,

My for-linus-4.11 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.11

Has Btrfs round two.  These are mostly a continuation of Dave Sterba's 
collection
of cleanups, but Filipe also has some bug fixes and performance improvements.

Nikolay Borisov (42) commits (+611/-579):
btrfs: Make lock_and_cleanup_extent_if_need take btrfs_inode (+14/-14)
btrfs: Make btrfs_delalloc_reserve_metadata take btrfs_inode (+39/-38)
btrfs: Make btrfs_extent_item_to_extent_map take btrfs_inode (+10/-8)
btrfs: all btrfs_delalloc_release_metadata take btrfs_inode (+22/-19)
btrfs: make btrfs_inode_resume_unlocked_dio take btrfs_inode (+3/-4)
btrfs: make btrfs_alloc_data_chunk_ondemand take btrfs_inode (+7/-6)
btrfs: make btrfs_inode_block_unlocked_dio take btrfs_inode (+3/-3)
btrfs: Make btrfs_orphan_release_metadata take btrfs_inode (+8/-8)
btrfs: Make btrfs_orphan_reserve_metadata take btrfs_inode (+7/-7)
btrfs: Make check_parent_dirs_for_sync take btrfs_inode (+14/-14)
btrfs: make btrfs_free_io_failure_record take btrfs_inode (+9/-7)
btrfs: Make btrfs_lookup_ordered_range take btrfs_inode (+19/-18)
btrfs: Make (__)btrfs_add_inode_defrag take btrfs_inode (+17/-16)
btrfs: make btrfs_print_data_csum_error take btrfs_inode (+8/-7)
btrfs: make btrfs_is_free_space_inode take btrfs_inode (+20/-19)
btrfs: make btrfs_set_inode_index_count take btrfs_inode (+8/-8)
btrfs: Make btrfs_requeue_inode_defrag take btrfs_inode (+5/-5)
btrfs: Make clone_update_extent_map take btrfs_inode (+13/-14)
btrfs: Make btrfs_mark_extent_written take btrfs_inode (+6/-6)
btrfs: Make btrfs_drop_extent_cache take btrfs_inode (+30/-26)
btrfs: Make calc_csum_metadata_size take btrfs_inode (+12/-15)
btrfs: Make drop_outstanding_extent take btrfs_inode (+11/-12)
btrfs: Make btrfs_del_delalloc_inode take btrfs_inode (+7/-7)
btrfs: make btrfs_log_inode_parent take btrfs_inode (+24/-26)
btrfs: Make btrfs_set_inode_index take btrfs_inode (+13/-13)
btrfs: Make btrfs_clear_bit_hook take btrfs_inode (+25/-21)
btrfs: Make check_extent_to_block take btrfs_inode (+6/-5)
btrfs: make check_compressed_csum take btrfs_inode (+4/-5)
btrfs: Make btrfs_insert_dir_item take btrfs_inode (+7/-7)
btrfs: Make btrfs_log_all_parents take btrfs_inode (+5/-5)
btrfs: Make btrfs_i_size_write take btrfs_inode (+18/-19)
btrfs: make repair_io_failure take btrfs_inode (+12/-11)
btrfs: Make btrfs_orphan_add take btrfs_inode (+24/-22)
btrfs: make btrfs_orphan_del take btrfs_inode (+20/-20)
btrfs: make clean_io_failure take btrfs_inode (+15/-14)
btrfs: Make btrfs_add_nondir take btrfs_inode (+13/-9)
btrfs: make free_io_failure take btrfs_inode (+13/-11)
btrfs: Make check_can_nocow take btrfs_inode (+12/-10)
btrfs: Make btrfs_add_link take btrfs_inode (+26/-23)
btrfs: Make get_extent_t take btrfs_inode (+59/-54)
btrfs: Make hole_mergeable take btrfs_inode (+5/-4)
btrfs: Make fill_holes take btrfs_inode (+18/-19)

David Sterba (16) commits (+139/-124):
btrfs: use predefined limits for calculating maximum number of pages for 
compression (+6/-5)
btrfs: derive maximum output size in the compression implementation (+9/-14)
btrfs: merge nr_pages input and output parameter in compress_pages (+11/-15)
btrfs: merge length input and output parameter in compress_pages (+18/-20)
btrfs: add dummy callback for readpage_io_failed and drop checks (+10/-3)
btrfs: do proper error handling in btrfs_insert_xattr_item (+2/-1)
btrfs: drop checks for mandatory extent_io_ops callbacks (+3/-4)
btrfs: constify device path passed to relevant helpers (+22/-18)
btrfs: document existence of extent_io ops callbacks (+26/-11)
btrfs: handle allocation error in update_dev_stat_item (+2/-1)
btrfs: export compression buffer limits in a header (+15/-10)
btrfs: constify name of subvolume in creation helpers (+3/-3)
btrfs: constify buffers used by compression helpers (+3/-3)
btrfs: remove BUG_ON from __tree_mod_log_insert (+0/-2)
btrfs: constify input buffer of btrfs_csum_data (+3/-3)
btrfs: let writepage_end_io_hook return void (+6/-11)

Filipe Manana (8) commits (+163/-27):
Btrfs: do not create explicit holes when replaying log tree if NO_HOLES 
enabled (+5/-0)
Btrfs: try harder to migrate items to left sibling before splitting a leaf 
(+7/-0)
Btrfs: fix assertion failure when freeing block groups at close_ctree() 
(+9/-6)
Btrfs: incremental send, fix unnecessary hole writes for sparse files 
(+86/-2)
Btrfs: fix use-after-free due to wrong order of destroying work queues 
(+7/-2)
Btrfs: incremental send, do not delay rename when parent inode is new 
(+16/-3)
Btrfs: fix data loss after truncate when using the no-holes feature (+6/-13)
Btrfs: bulk delete checksum items in the same leaf (+27/-1)

Robbie Ko (3) commits 

[GIT PULL] Btrfs

2017-02-24 Thread Chris Mason
Hi Linus,

My for-linus-4.11 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.11

Has a series of fixes and cleanups that Dave Sterba has been collecting:

There is a pretty big variety here, cleaning up internal APIs and fixing 
corner cases.

David Sterba (46) commits (+235/-313):
 btrfs: remove unused parameter from btrfs_subvolume_release_metadata 
(+6/-11)
 btrfs: remove pointless rcu protection from btrfs_qgroup_inherit (+0/-2)
 btrfs: check quota status earlier and don't do unnecessary frees (+3/-2)
 btrfs: remove unused parameter from btrfs_prepare_extent_commit (+3/-5)
 btrfs: remove unnecessary mutex lock in qgroup_account_snapshot (+1/-5)
 btrfs: embed extent_changeset::range_changed to the structure (+11/-17)
 btrfs: remove unused parameter from cleanup_write_cache_enospc (+2/-3)
 btrfs: remove unused parameters from __btrfs_write_out_cache (+3/-8)
 btrfs: remove unused parameter from clone_copy_inline_extent (+2/-3)
 btrfs: remove unused parameter from extent_write_cache_pages (+2/-4)
 btrfs: remove unused parameter from tree_move_next_or_upnext (+2/-4)
 btrfs: remove unused parameter from btrfs_check_super_valid (+3/-5)
 btrfs: remove unused logic of limiting async delalloc pages (+0/-7)
 btrfs: fix over-80 lines introduced by previous cleanups (+74/-63)
 btrfs: remove unused parameter from read_block_for_search (+5/-5)
 btrfs: remove unused parameter from adjust_slots_upwards (+2/-3)
 btrfs: remove unused parameter from init_first_rw_device (+3/-5)
 btrfs: make space cache inode readahead failure nonfatal (+3/-7)
 btrfs: remove unused parameters from scrub_setup_wr_ctx (+3/-7)
 btrfs: remove unused parameter from __btrfs_alloc_chunk (+4/-6)
 btrfs: add wrapper for counting BTRFS_MAX_EXTENT_SIZE (+23/-31)
 btrfs: remove unused parameter from submit_extent_page (+3/-9)
 btrfs: remove unused parameter from clean_tree_block (+17/-19)
 btrfs: use GFP_KERNEL in btrfs_add/del_qgroup_relation (+2/-2)
 btrfs: remove unused parameter from __add_inline_refs (+2/-3)
 btrfs: remove unused parameter from add_pending_csums (+2/-4)
 btrfs: remove unused parameter from update_nr_written (+4/-4)
 btrfs: remove unused parameter from __push_leaf_right (+2/-3)
 btrfs: remove unused parameter from check_async_write (+2/-2)
 btrfs: remove unused parameter from btrfs_fill_super (+2/-3)
 btrfs: remove unused parameter from __push_leaf_left (+2/-3)
 btrfs: remove unused parameter from write_dev_supers (+3/-3)
 btrfs: remove unused parameter from __add_inode_ref (+1/-2)
 btrfs: remove unused parameters from btrfs_cmp_data (+2/-3)
 btrfs: remove unused parameter from create_snapshot (+2/-2)
 btrfs: ulist: make the finalization function public (+2/-1)
 btrfs: remove unused parameter from tree_move_down (+2/-2)
 btrfs: ulist: rename ulist_fini to ulist_release (+10/-10)
 btrfs: qgroups: make __del_qgroup_relation static (+1/-1)
 btrfs: use GFP_KERNEL in btrfs_read_qgroup_config (+1/-1)
 btrfs: remove unused parameter from split_item (+2/-3)
 btrfs: merge two superblock writing helpers (+4/-11)
 btrfs: qgroups: opencode qgroup_free helper (+9/-9)
 btrfs: use GFP_KERNEL in btrfs_quota_enable (+1/-1)
 btrfs: use GFP_KERNEL in create_snapshot (+2/-2)
 btrfs: remove unused ulist members (+0/-7)

Nikolay Borisov (36) commits (+476/-480):
 btrfs: Make btrfs_delayed_inode_reserve_metadata take btrfs_inode (+8/-8)
 btrfs: Make btrfs_inode_delayed_dir_index_count take btrfs_inode (+5/-5)
 btrfs: Make btrfs_commit_inode_delayed_items take btrfs_inode (+4/-4)
 btrfs: Make btrfs_commit_inode_delayed_inode take btrfs_inode (+6/-6)
 btrfs: Make btrfs_get_or_create_delayed_node take btrfs_inode (+5/-6)
 btrfs: Make btrfs_kill_delayed_inode_items take btrfs_inode (+4/-4)
 btrfs: Make btrfs_delayed_delete_inode_ref take btrfs_inode (+5/-5)
 btrfs: Make btrfs_delete_delayed_dir_index take btrfs_inode (+6/-6)
 btrfs: Make btrfs_insert_delayed_dir_index take btrfs_inode (+5/-5)
 btrfs: Make btrfs_check_ref_name_override take btrfs_inode (+4/-5)
 btrfs: Make btrfs_record_snapshot_destroy take btrfs_inode (+6/-6)
 btrfs: Make btrfs_must_commit_transaction take btrfs_inode (+9/-9)
 btrfs: Make btrfs_del_dir_entries_in_log take btrfs_inode (+7/-7)
 btrfs: Make btrfs_log_changed_extents take btrfs_inode (+11/-11)
 btrfs: Make btrfs_record_unlink_dir take btrfs_inode (+14/-14)
 btrfs: Make btrfs_remove_delayed_node take btrfs_inode (+5/-5)
 btrfs: Make btrfs_get_logged_extents take btrfs_inode (+4/-4)
 btrfs: Make btrfs_log_trailing_hole take btrfs_inode (+4/-4)
 btrfs: Make btrfs_get_delayed_node take btrfs_inode (+8/-9)
 btrfs: Make btrfs_ino take a struct btrfs_inode (+151/-151)
 btrfs: Make log_directory_changes take btrfs_inode (+5/-6)
   

Re: [GIT PULL] Btrfs bug fixes and improvements for 4.11 (2nd retry)

2017-02-24 Thread Chris Mason

On Fri, Feb 24, 2017 at 03:25:09AM +, fdman...@kernel.org wrote:

From: Filipe Manana 

Hi Chris, since my previous pull request (sent timely) was either missed
or not pulled for some reason I'm not aware of, here I send it again (with
one more patch included). The following is taken from the former pull
request:


Hi Filipe, I've got this queued up and will send Monday/Tuesday.

Thanks!

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs bug fixes and improvements for 4.11 (2nd retry)

2017-02-24 Thread fdmanana
From: Filipe Manana 

Hi Chris, since my previous pull request (sent timely) was either missed
or not pulled for some reason I'm not aware of, here I send it again (with
one more patch included). The following is taken from the former pull
request:

"Please consider the following changes for the 4.11 merge window.
This time there is nothing particularly outstanding when compared to the
usual set of bug fixes. These are mostly fixes for send and the no-holes
feature introduced in 3.14. Test cases for fstests were sent for half of
these changes, with some already merged and two not yet merged."

This was rebased against your current for-linus-4.11 branch and re-tested.

Thanks.

The following changes since commit 6288d6eabc7505f42dda34a2c2962f91914be3a4:

  Btrfs: use the correct type when creating cow dio extent (2017-02-22 15:55:03 
-0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
for-chris-4.11

for you to fetch changes up to 263d3995c93c6020576f6c93506412a0b9d1e932:

  Btrfs: try harder to migrate items to left sibling before splitting a leaf 
(2017-02-24 00:39:44 +)


Filipe Manana (8):
  Btrfs: incremental send, do not delay rename when parent inode is new
  Btrfs: bulk delete checksum items in the same leaf
  Btrfs: do not create explicit holes when replaying log tree if NO_HOLES 
enabled
  Btrfs: fix assertion failure when freeing block groups at close_ctree()
  Btrfs: fix use-after-free due to wrong order of destroying work queues
  Btrfs: incremental send, fix unnecessary hole writes for sparse files
  Btrfs: fix data loss after truncate when using the no-holes feature
  Btrfs: try harder to migrate items to left sibling before splitting a leaf

Robbie Ko (3):
  Btrfs: send, fix failure to rename top level inode due to name collision
  Btrfs: incremental send, do not issue invalid rmdir operations
  Btrfs: fix leak of subvolume writers counter

 fs/btrfs/ctree.c   |   7 +++
 fs/btrfs/disk-io.c |  15 ++-
 fs/btrfs/extent-tree.c |   9 ++---
 fs/btrfs/file-item.c   |  28 +++-
 fs/btrfs/inode.c   |  29 ++---
 fs/btrfs/send.c| 125 
+++--
 fs/btrfs/tree-log.c|   5 +
 7 files changed, 188 insertions(+), 30 deletions(-)

-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes and improvements for 4.11

2017-02-16 Thread fdmanana
From: Filipe Manana 

Hi Chris.

Please consider the following changes for the 4.11 merge window.
This time there is nothing particularly outstanding when compared to the
usual set of bug fixes. These are mostly fixes for send and the no-holes
feature introduced in 3.14. Test cases for fstests were sent for half of
these changes, with some already merged and two not yet merged.

Thanks.

The following changes since commit 6e78b3f7a193546b1c00a6d084596e774f147169:

  Btrfs: fix btrfs_decompress_buf2page() (2017-02-10 19:11:03 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
for-chris-4.11

for you to fetch changes up to 0a511ba79d7152b5b3b6b54573511fbdeb014abb:

  Btrfs: fix data loss after truncate when using the no-holes feature 
(2017-02-15 20:16:19 +)


Filipe Manana (7):
  Btrfs: incremental send, do not delay rename when parent inode is new
  Btrfs: bulk delete checksum items in the same leaf
  Btrfs: do not create explicit holes when replaying log tree if NO_HOLES 
enabled
  Btrfs: fix assertion failure when freeing block groups at close_ctree()
  Btrfs: fix use-after-free due to wrong order of destroying work queues
  Btrfs: incremental send, fix unnecessary hole writes for sparse files
  Btrfs: fix data loss after truncate when using the no-holes feature

Robbie Ko (3):
  Btrfs: send, fix failure to rename top level inode due to name collision
  Btrfs: incremental send, do not issue invalid rmdir operations
  Btrfs: fix leak of subvolume writers counter

 fs/btrfs/disk-io.c |  15 ++-
 fs/btrfs/extent-tree.c |   9 ++---
 fs/btrfs/file-item.c   |  28 +++-
 fs/btrfs/inode.c   |  29 ++---
 fs/btrfs/send.c| 125 
+++--
 fs/btrfs/tree-log.c|   5 +
 6 files changed, 181 insertions(+), 30 deletions(-)

-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2017-02-11 Thread Chris Mason
Hi Linus,

My for-linus-4.10 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.10

Has two last minute fixes.  The highest priority here is a regression 
fix for the decompression code, but we also fixed up a problem with the 
32 bit compat ioctls.

The decompression bug could hand back the wrong data on big reads when 
zlib was used.  I have a larger cleanup to make the math here less error 
prone, but at this stage in the release Omar's patch is the best choice.

Omar Sandoval (1) commits (+24/-15):
 Btrfs: fix btrfs_decompress_buf2page()

Jeff Mahoney (1) commits (+4/-2):
 btrfs: fix btrfs_compat_ioctl failures on non-compat ioctls

Total: (2) commits (+28/-17)

  fs/btrfs/compression.c | 39 ---
  fs/btrfs/ioctl.c   |  6 --
  2 files changed, 28 insertions(+), 17 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2017-01-27 Thread Chris Mason
Hi Linus,

My for-linus-4.10 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.10

Has some fixes that we've collected from the list.  We still have one 
more pending to nail down a regression in lzo compression, but I wanted 
to get this batch out the door.

Omar Sandoval (3) commits (+2/-6):
 Btrfs: remove ->{get, set}_acl() from btrfs_dir_ro_inode_operations (+0/-2)
 Btrfs: remove old tree_root case in btrfs_read_locked_inode() (+1/-4)
 Btrfs: disable xattr operations on subvolume directories (+1/-0)

Liu Bo (1) commits (+12/-1):
 Btrfs: fix truncate down when no_holes feature is enabled

Chandan Rajendra (1) commits (+2/-2):
 Btrfs: Fix deadlock between direct IO and fast fsync

Wang Xiaoguang (1) commits (+1/-0):
 btrfs: fix false enospc error when truncating heavily reflinked file

Total: (6) commits (+17/-9)

  fs/btrfs/inode.c | 26 +-
  1 file changed, 17 insertions(+), 9 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes

2017-01-13 Thread Chris Mason
Hi Linus,

Dave Sterba queued up a few fixes for btrfs.  I have them in my
for-linus-4.10 branch:

These are all over the place.  The tracepoint part of the pull fixes a
crash and adds a little more information to two tracepoints, while the
rest are good old fashioned fixes.

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.10

Liu Bo (5) commits (+34/-11):
Btrfs: adjust outstanding_extents counter properly when dio write is split 
(+9/-2)
Btrfs: add truncated_len for ordered extent tracepoints (+4/-0)
Btrfs: use down_read_nested to make lockdep silent (+2/-1)
Btrfs: add 'inode' for extent map tracepoint (+9/-5)
Btrfs: fix lockdep warning about log_mutex (+10/-3)

David Sterba (2) commits (+80/-69):
btrfs: fix crash when tracepoint arguments are freed by wq callbacks 
(+24/-13)
btrfs: make tracepoint format strings more compact (+56/-56)

Jeff Mahoney (2) commits (+4/-1):
btrfs: fix locking when we put back a delayed ref that's too new (+1/-1)
btrfs: fix error handling when run_delayed_extent_op fails (+3/-0)

Pan Bian (1) commits (+1/-3):
btrfs: return the actual error value from  from btrfs_uuid_tree_iterate

Total: (10) commits (+119/-84)

 fs/btrfs/async-thread.c  |  15 +++--
 fs/btrfs/extent-tree.c   |   8 ++-
 fs/btrfs/inode.c |  13 +++-
 fs/btrfs/tree-log.c  |  13 +++-
 fs/btrfs/uuid-tree.c |   4 +-
 include/trace/events/btrfs.h | 146 +++
 6 files changed, 117 insertions(+), 82 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] btrfs fixes and cleanups

2017-01-12 Thread Qu Wenruo



At 01/13/2017 12:10 AM, Liu Bo wrote:

Hi,

On Wed, Dec 28, 2016 at 05:30:59PM +0800, Qu Wenruo wrote:

Hi Liu,

At 12/15/2016 03:13 PM, Liu Bo wrote:

Hi David,

This is the collection of my patches targetting 4.10, I've
dropped patch "Btrfs: adjust len of writes if following a
preallocated extent" because of the deadlock caused by this
commit.

Patches are based on v4.9-rc8, and test against fstests with
default mount options has been taken to make sure it doesn't
break anything.

I haven't got a kernel.org git repo, so this is mainly for
tracking purpose and for testing git flow.

(cherry-pick patches might be the only way at this moment...sorry
for the inconvenience.)

Anyway, patches can be found at

https://github.com/liubogithub/btrfs-work.git for-dave

Thanks,
liubo

Liu Bo (9):
  Btrfs: add 'inode' for extent map tracepoint
  Btrfs: add truncated_len for ordered extent tracepoints
  Btrfs: use down_read_nested to make lockdep silent
  Btrfs: fix lockdep warning about log_mutex
  Btrfs: fix truncate down when no_holes feature is enabled
  Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly
  Btrfs: fix comment in btrfs_page_mkwrite
  Btrfs: clean up btrfs_ordered_update_i_size


While testing David's for-next-20161219 branch, I found btrfs/06[0-5] will
cause the following kernel panic when ran them in a row.

[ 4207.963063] assertion failed: disk_i_size < i_size, file:
fs/btrfs//ordered-data.c, line: 1041
[ 4207.963722] [ cut here ]
[ 4207.964008] kernel BUG at fs/btrfs//ctree.h:3418!
[ 4207.964008] invalid opcode:  [#1] SMP
[ 4207.964008] Modules linked in: btrfs(O) netconsole ext4 jbd2 mbcache xor
zlib_deflate raid6_pq xfs [last unloaded: btrfs]
[ 4207.964008] CPU: 0 PID: 3829 Comm: kworker/u4:5 Tainted: G O4.9.0+
#60
[ 4207.964008] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
1.10.1-20161122_114906-anatol 04/01/2014
[ 4207.964008] Workqueue: btrfs-endio-write btrfs_endio_write_helper [btrfs]
[ 4207.964008] task: 88000bbf8040 task.stack: c90006598000
[ 4207.964008] RIP: 0010:[]  []
assfail.constprop.10+0x1c/0x1e [btrfs]

[ 4207.964008] Call Trace:
[ 4207.964008]  [] btrfs_ordered_update_i_size+0x2b1/0x2e0
[btrfs]
[ 4207.964008]  [] btrfs_finish_ordered_io+0x335/0x6b0
[btrfs]
[ 4207.964008]  [] finish_ordered_fn+0x15/0x20 [btrfs]
[ 4207.964008]  [] btrfs_scrubparity_helper+0xef/0x610
[btrfs]
[ 4207.964008]  [] btrfs_endio_write_helper+0xe/0x10
[btrfs]
[ 4207.964008]  [] process_one_work+0x2af/0x720
[ 4207.964008]  [] ? process_one_work+0x22b/0x720
[ 4207.964008]  [] worker_thread+0x4b/0x4f0
[ 4207.964008]  [] ? process_one_work+0x720/0x720
[ 4207.964008]  [] ? process_one_work+0x720/0x720
[ 4207.964008]  [] kthread+0xf3/0x110
[ 4207.964008]  [] ? kthread_park+0x60/0x60
[ 4207.964008]  [] ret_from_fork+0x27/0x40
[ 4207.964008] Code: c7 00 e4 46 a0 48 89 e5 e8 c8 3c d8 e0 0f 0b 55 89 f1
48 c7 c2 83 90 46 a0 48 89 fe 48 c7 c7 b0 e4 46 a0 48 89 e5 e8 aa 3c d8 e0
<0f> 0b 55 89 f1 48 c7 c2 fb 90 46 a0 48 89 fe 48 c7 c7 e8 e5 46
[ 4207.964008] RIP  [] assfail.constprop.10+0x1c/0x1e
[btrfs]
[ 4207.964008]  RSP 
[ 4207.964008] ---[ end trace f7759d2fce14da9f ]---

Not sure if it's related to patch or just it exposed some bug we don't find
before.

Hopes it will help.



Thanks for spotting it, just found out that this ASSERT is not true any
more after patch "Btrfs: fix btrfs_ordered_update_i_size to update
disk_i_size properly".

I'm doing a v2 to remove it.


Glad it's not a big problem.

Thanks,
Qu



Thanks,

-liubo


Thanks,
Qu


  Btrfs: fix another race between truncate and lockless dio write

 fs/btrfs/extent-tree.c   |  3 ++-
 fs/btrfs/inode.c | 43 +++
 fs/btrfs/ordered-data.c  | 42 --
 fs/btrfs/tree-log.c  | 13 ++---
 include/trace/events/btrfs.h | 16 
 5 files changed, 83 insertions(+), 34 deletions(-)










--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] btrfs fixes and cleanups

2017-01-12 Thread Liu Bo
Hi,

On Wed, Dec 28, 2016 at 05:30:59PM +0800, Qu Wenruo wrote:
> Hi Liu,
> 
> At 12/15/2016 03:13 PM, Liu Bo wrote:
> > Hi David,
> > 
> > This is the collection of my patches targetting 4.10, I've
> > dropped patch "Btrfs: adjust len of writes if following a
> > preallocated extent" because of the deadlock caused by this
> > commit.
> > 
> > Patches are based on v4.9-rc8, and test against fstests with
> > default mount options has been taken to make sure it doesn't
> > break anything.
> > 
> > I haven't got a kernel.org git repo, so this is mainly for
> > tracking purpose and for testing git flow.
> > 
> > (cherry-pick patches might be the only way at this moment...sorry
> > for the inconvenience.)
> > 
> > Anyway, patches can be found at
> > 
> > https://github.com/liubogithub/btrfs-work.git for-dave
> > 
> > Thanks,
> > liubo
> > 
> > Liu Bo (9):
> >   Btrfs: add 'inode' for extent map tracepoint
> >   Btrfs: add truncated_len for ordered extent tracepoints
> >   Btrfs: use down_read_nested to make lockdep silent
> >   Btrfs: fix lockdep warning about log_mutex
> >   Btrfs: fix truncate down when no_holes feature is enabled
> >   Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly
> >   Btrfs: fix comment in btrfs_page_mkwrite
> >   Btrfs: clean up btrfs_ordered_update_i_size
> 
> While testing David's for-next-20161219 branch, I found btrfs/06[0-5] will
> cause the following kernel panic when ran them in a row.
> 
> [ 4207.963063] assertion failed: disk_i_size < i_size, file:
> fs/btrfs//ordered-data.c, line: 1041
> [ 4207.963722] [ cut here ]
> [ 4207.964008] kernel BUG at fs/btrfs//ctree.h:3418!
> [ 4207.964008] invalid opcode:  [#1] SMP
> [ 4207.964008] Modules linked in: btrfs(O) netconsole ext4 jbd2 mbcache xor
> zlib_deflate raid6_pq xfs [last unloaded: btrfs]
> [ 4207.964008] CPU: 0 PID: 3829 Comm: kworker/u4:5 Tainted: G O4.9.0+
> #60
> [ 4207.964008] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
> 1.10.1-20161122_114906-anatol 04/01/2014
> [ 4207.964008] Workqueue: btrfs-endio-write btrfs_endio_write_helper [btrfs]
> [ 4207.964008] task: 88000bbf8040 task.stack: c90006598000
> [ 4207.964008] RIP: 0010:[]  []
> assfail.constprop.10+0x1c/0x1e [btrfs]
> 
> [ 4207.964008] Call Trace:
> [ 4207.964008]  [] btrfs_ordered_update_i_size+0x2b1/0x2e0
> [btrfs]
> [ 4207.964008]  [] btrfs_finish_ordered_io+0x335/0x6b0
> [btrfs]
> [ 4207.964008]  [] finish_ordered_fn+0x15/0x20 [btrfs]
> [ 4207.964008]  [] btrfs_scrubparity_helper+0xef/0x610
> [btrfs]
> [ 4207.964008]  [] btrfs_endio_write_helper+0xe/0x10
> [btrfs]
> [ 4207.964008]  [] process_one_work+0x2af/0x720
> [ 4207.964008]  [] ? process_one_work+0x22b/0x720
> [ 4207.964008]  [] worker_thread+0x4b/0x4f0
> [ 4207.964008]  [] ? process_one_work+0x720/0x720
> [ 4207.964008]  [] ? process_one_work+0x720/0x720
> [ 4207.964008]  [] kthread+0xf3/0x110
> [ 4207.964008]  [] ? kthread_park+0x60/0x60
> [ 4207.964008]  [] ret_from_fork+0x27/0x40
> [ 4207.964008] Code: c7 00 e4 46 a0 48 89 e5 e8 c8 3c d8 e0 0f 0b 55 89 f1
> 48 c7 c2 83 90 46 a0 48 89 fe 48 c7 c7 b0 e4 46 a0 48 89 e5 e8 aa 3c d8 e0
> <0f> 0b 55 89 f1 48 c7 c2 fb 90 46 a0 48 89 fe 48 c7 c7 e8 e5 46
> [ 4207.964008] RIP  [] assfail.constprop.10+0x1c/0x1e
> [btrfs]
> [ 4207.964008]  RSP 
> [ 4207.964008] ---[ end trace f7759d2fce14da9f ]---
> 
> Not sure if it's related to patch or just it exposed some bug we don't find
> before.
> 
> Hopes it will help.
>

Thanks for spotting it, just found out that this ASSERT is not true any
more after patch "Btrfs: fix btrfs_ordered_update_i_size to update
disk_i_size properly".

I'm doing a v2 to remove it.

Thanks,

-liubo
 
> Thanks,
> Qu
> 
> >   Btrfs: fix another race between truncate and lockless dio write
> > 
> >  fs/btrfs/extent-tree.c   |  3 ++-
> >  fs/btrfs/inode.c | 43 
> > +++
> >  fs/btrfs/ordered-data.c  | 42 
> > --
> >  fs/btrfs/tree-log.c  | 13 ++---
> >  include/trace/events/btrfs.h | 16 
> >  5 files changed, 83 insertions(+), 34 deletions(-)
> > 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] btrfs fixes and cleanups

2016-12-28 Thread Qu Wenruo

Hi Liu,

At 12/15/2016 03:13 PM, Liu Bo wrote:

Hi David,

This is the collection of my patches targetting 4.10, I've
dropped patch "Btrfs: adjust len of writes if following a
preallocated extent" because of the deadlock caused by this
commit.

Patches are based on v4.9-rc8, and test against fstests with
default mount options has been taken to make sure it doesn't
break anything.

I haven't got a kernel.org git repo, so this is mainly for
tracking purpose and for testing git flow.

(cherry-pick patches might be the only way at this moment...sorry
for the inconvenience.)

Anyway, patches can be found at

https://github.com/liubogithub/btrfs-work.git for-dave

Thanks,
liubo

Liu Bo (9):
  Btrfs: add 'inode' for extent map tracepoint
  Btrfs: add truncated_len for ordered extent tracepoints
  Btrfs: use down_read_nested to make lockdep silent
  Btrfs: fix lockdep warning about log_mutex
  Btrfs: fix truncate down when no_holes feature is enabled
  Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly
  Btrfs: fix comment in btrfs_page_mkwrite
  Btrfs: clean up btrfs_ordered_update_i_size


While testing David's for-next-20161219 branch, I found btrfs/06[0-5] 
will cause the following kernel panic when ran them in a row.


[ 4207.963063] assertion failed: disk_i_size < i_size, file: 
fs/btrfs//ordered-data.c, line: 1041

[ 4207.963722] [ cut here ]
[ 4207.964008] kernel BUG at fs/btrfs//ctree.h:3418!
[ 4207.964008] invalid opcode:  [#1] SMP
[ 4207.964008] Modules linked in: btrfs(O) netconsole ext4 jbd2 mbcache 
xor zlib_deflate raid6_pq xfs [last unloaded: btrfs]
[ 4207.964008] CPU: 0 PID: 3829 Comm: kworker/u4:5 Tainted: G 
O4.9.0+ #60
[ 4207.964008] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 
1.10.1-20161122_114906-anatol 04/01/2014

[ 4207.964008] Workqueue: btrfs-endio-write btrfs_endio_write_helper [btrfs]
[ 4207.964008] task: 88000bbf8040 task.stack: c90006598000
[ 4207.964008] RIP: 0010:[]  [] 
assfail.constprop.10+0x1c/0x1e [btrfs]


[ 4207.964008] Call Trace:
[ 4207.964008]  [] 
btrfs_ordered_update_i_size+0x2b1/0x2e0 [btrfs]
[ 4207.964008]  [] btrfs_finish_ordered_io+0x335/0x6b0 
[btrfs]

[ 4207.964008]  [] finish_ordered_fn+0x15/0x20 [btrfs]
[ 4207.964008]  [] btrfs_scrubparity_helper+0xef/0x610 
[btrfs]
[ 4207.964008]  [] btrfs_endio_write_helper+0xe/0x10 
[btrfs]

[ 4207.964008]  [] process_one_work+0x2af/0x720
[ 4207.964008]  [] ? process_one_work+0x22b/0x720
[ 4207.964008]  [] worker_thread+0x4b/0x4f0
[ 4207.964008]  [] ? process_one_work+0x720/0x720
[ 4207.964008]  [] ? process_one_work+0x720/0x720
[ 4207.964008]  [] kthread+0xf3/0x110
[ 4207.964008]  [] ? kthread_park+0x60/0x60
[ 4207.964008]  [] ret_from_fork+0x27/0x40
[ 4207.964008] Code: c7 00 e4 46 a0 48 89 e5 e8 c8 3c d8 e0 0f 0b 55 89 
f1 48 c7 c2 83 90 46 a0 48 89 fe 48 c7 c7 b0 e4 46 a0 48 89 e5 e8 aa 3c 
d8 e0 <0f> 0b 55 89 f1 48 c7 c2 fb 90 46 a0 48 89 fe 48 c7 c7 e8 e5 46
[ 4207.964008] RIP  [] assfail.constprop.10+0x1c/0x1e 
[btrfs]

[ 4207.964008]  RSP 
[ 4207.964008] ---[ end trace f7759d2fce14da9f ]---

Not sure if it's related to patch or just it exposed some bug we don't 
find before.


Hopes it will help.

Thanks,
Qu


  Btrfs: fix another race between truncate and lockless dio write

 fs/btrfs/extent-tree.c   |  3 ++-
 fs/btrfs/inode.c | 43 +++
 fs/btrfs/ordered-data.c  | 42 --
 fs/btrfs/tree-log.c  | 13 ++---
 include/trace/events/btrfs.h | 16 
 5 files changed, 83 insertions(+), 34 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] btrfs fixes and cleanups

2016-12-20 Thread David Sterba
On Wed, Dec 14, 2016 at 11:13:32PM -0800, Liu Bo wrote:
> This is the collection of my patches targetting 4.10, I've
> dropped patch "Btrfs: adjust len of writes if following a
> preallocated extent" because of the deadlock caused by this
> commit.
> 
> Patches are based on v4.9-rc8, and test against fstests with
> default mount options has been taken to make sure it doesn't
> break anything.
> 
> I haven't got a kernel.org git repo, so this is mainly for
> tracking purpose and for testing git flow.
> 
> (cherry-pick patches might be the only way at this moment...sorry
> for the inconvenience.)
> 
> Anyway, patches can be found at
> 
>   https://github.com/liubogithub/btrfs-work.git for-dave

Thanks, I've added this branch to my list for-next source branches. Once
the merge window is closed, your branch will be part of the published
for-next.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-12-16 Thread Chris Mason
Hi Linus,

My for-linus-4.10 branch has our merge window fun:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.10

There is a trivial conflict with your current git, my resolution is
here:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.10-merged

Jeff Mahoney and Dave Sterba have a really nice set of cleanups in here,
and Christoph pitched in corrections/improvements to make btrfs use
proper helpers for bio walking instead of doing it by hand.

There are some key fixes as well, including some long standing bugs that
took forever to track down in btrfs_drop_extents and during balance.

-chris

Jeff Mahoney (22) commits (+4537/-4467):
btrfs: call functions that always use the same root with fs_info instead 
(+115/-102)
btrfs: split btrfs_wait_marked_extents into normal and tree log functions 
(+58/-40)
btrfs: take an fs_info directly when the root is not used otherwise 
(+1119/-1243)
btrfs: increment ctx->pos for every emitted or skipped dirent in readdir 
(+4/-23)
btrfs: call functions that overwrite their root parameter with fs_info 
(+52/-60)
btrfs: Ensure proper sector alignment for btrfs_free_reserved_data_space 
(+7/-0)
btrfs: remove old tree_root dirent processing in btrfs_real_readdir() 
(+37/-80)
btrfs: root->fs_info cleanup, btrfs_calc_{trans,trunc}_metadata_size 
(+37/-32)
btrfs: remove root parameter from transaction commit/end routines 
(+188/-211)
btrfs: root->fs_info cleanup, access fs_info->delayed_root directly 
(+13/-24)
btrfs: root->fs_info cleanup, add fs_info convenience variables 
(+2251/-2016)
btrfs: pull node/sector/stripe sizes out of root and into fs_info 
(+432/-414)
btrfs: alloc_reserved_file_extent trace point should use extent_root (+2/-1)
btrfs: root->fs_info cleanup, use fs_info->dev_root everywhere (+68/-70)
btrfs: root->fs_info cleanup, update_block_group{,flags} (+14/-14)
btrfs: struct reada_control.root -> reada_control.fs_info (+8/-7)
btrfs: btrfs_init_new_device should use fs_info->dev_root (+4/-3)
btrfs: struct btrfsic_state->root should be an fs_info (+10/-10)
btrfs: convert extent-tree tracepoints to use fs_info (+30/-36)
btrfs: root->fs_info cleanup, lock/unlock_chunks (+47/-47)
btrfs: simplify btrfs_wait_cache_io prototype (+34/-27)
btrfs: root->fs_info cleanup, io_ctl_init (+7/-7)

David Sterba (17) commits (+166/-168):
btrfs: store and load values of stripes_min/stripes_max in balance status 
item (+4/-0)
btrfs: remove constant parameter to memset_extent_buffer and rename it 
(+21/-21)
btrfs: use specialized page copying helpers in btrfs_clone_extent_buffer 
(+1/-1)
btrfs: reada, cleanup remove unneeded variable in __readahead_hook (+1/-5)
btrfs: reada, remove unused parameter from __readahead_hook (+4/-4)
btrfs: rename helper macros for qgroup and aux data casts (+21/-14)
btrfs: reada, remove pointless BUG_ON in reada_find_extent (+0/-1)
btrfs: reada, sink start parameter to btree_readahead_hook (+5/-9)
btrfs: reada, remove pointless BUG_ON check for fs_info (+0/-1)
btrfs: remove trivial helper btrfs_find_tree_block (+7/-15)
btrfs: opencode chunk locking, remove helpers (+43/-53)
btrfs: introduce helpers for updating eb uuids (+24/-0)
btrfs: add optimized version of eb to eb copy (+18/-2)
btrfs: remove stale comment from btrfs_statfs (+0/-4)
btrfs: use new helpers to set uuids in eb (+17/-34)
btrfs: delete unused member from superblock (+0/-1)
btrfs: remove unused headers, statfs.h (+0/-3)

Christoph Hellwig (9) commits (+176/-233):
btrfs: refactor __btrfs_lookup_bio_sums to use bio_for_each_segment_all 
(+11/-21)
btrfs: use bio_for_each_segment_all in __btrfsic_submit_bio (+11/-19)
btrfs: don't access the bio directly in btrfs_csum_one_bio (+10/-11)
btrfs: don't access the bio directly in the direct I/O code (+3/-4)
btrfs: use bio iterators for the decompression handlers (+55/-112)
btrfs: don't access the bio directly in the raid5/6 code (+6/-10)
btrfs: don't abuse REQ_OP_* flags for btrfs_map_block (+70/-49)
btrfs: calculate end of bio offset properly (+8/-2)
btrfs: use bi_size (+2/-5)

Filipe Manana (5) commits (+25/-33):
Btrfs: fix emptiness check for dirtied extent buffers at check_leaf() 
(+12/-1)
Btrfs: remove unused code when creating and merging reloc trees (+0/-19)
Btrfs: remove rb_node field from the delayed ref node structure (+0/-6)
Btrfs: fix relocation incorrectly dropping data references (+12/-3)
Btrfs: fix qgroup rescan worker initialization (+1/-4)

Qu Wenruo (4) commits (+308/-330):
btrfs: qgroup: Rename functions to make it follow reserve,trace,account 
steps (+18/-17)
btrfs: Export and move leaf/subtree qgroup helpers to qgroup.c (+240/-217)
btrfs: qgroup: Fix qgroup data leaking by using subtree tracing (+23/-96)
btrfs: qgroup: Add comments 

[GIT PULL] btrfs fixes and cleanups

2016-12-14 Thread Liu Bo
Hi David,

This is the collection of my patches targetting 4.10, I've
dropped patch "Btrfs: adjust len of writes if following a
preallocated extent" because of the deadlock caused by this
commit.

Patches are based on v4.9-rc8, and test against fstests with
default mount options has been taken to make sure it doesn't
break anything.

I haven't got a kernel.org git repo, so this is mainly for
tracking purpose and for testing git flow.

(cherry-pick patches might be the only way at this moment...sorry
for the inconvenience.)

Anyway, patches can be found at

https://github.com/liubogithub/btrfs-work.git for-dave

Thanks,
liubo

Liu Bo (9):
  Btrfs: add 'inode' for extent map tracepoint
  Btrfs: add truncated_len for ordered extent tracepoints
  Btrfs: use down_read_nested to make lockdep silent
  Btrfs: fix lockdep warning about log_mutex
  Btrfs: fix truncate down when no_holes feature is enabled
  Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly
  Btrfs: fix comment in btrfs_page_mkwrite
  Btrfs: clean up btrfs_ordered_update_i_size
  Btrfs: fix another race between truncate and lockless dio write

 fs/btrfs/extent-tree.c   |  3 ++-
 fs/btrfs/inode.c | 43 +++
 fs/btrfs/ordered-data.c  | 42 --
 fs/btrfs/tree-log.c  | 13 ++---
 include/trace/events/btrfs.h | 16 
 5 files changed, 83 insertions(+), 34 deletions(-)

-- 
2.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.10

2016-11-30 Thread fdmanana
From: Filipe Manana 

Hi Chris,

Here follows a small list of fixes a couple cleanups for the 4.10 merge
window. It contains all the patches from the previous pull request (which
got unanswered nor were the changes pulled yet apparently). The most important
change is still the fix for the extent tree corruption that happens due to
balance when qgroups are enabled (a regression introduced in 4.7 by a fix for
a regression from the last qgroups rework). This has been hitting SLE and
openSUSE users and QA very badly, where transactions keep getting aborted when
running delayed references leaving the root filesystem in RO mode and nearly
unusable.
There are fixes here that allow us to run xfstests again with the integrity
checker enabled, which has been impossible since 4.8 (apparently I'm the
only one running xfstests with the integrity checker enabled, which is useful
to validate dirtied leafs, like checking if there are keys out of order, etc).
The rest are just some trivial fixes, most of them tagged for stable, and two
cleanups.

Thanks.

The following changes since commit e3597e6090ddf40904dce6d0a5a404e2c490cac6:

  Merge branch 'for-4.9-rc3' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.9 
(2016-11-01 12:54:45 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
for-chris-4.10

for you to fetch changes up to 2a7bf53f577e49c43de4ffa7776056de26db65d9:

  Btrfs: fix tree search logic when replaying directory entry deletes 
(2016-11-30 16:56:12 +)


Filipe Manana (5):
  Btrfs: fix relocation incorrectly dropping data references
  Btrfs: remove unused code when creating and merging reloc trees
  Btrfs: remove rb_node field from the delayed ref node structure
  Btrfs: fix emptiness check for dirtied extent buffers at check_leaf()
  Btrfs: fix qgroup rescan worker initialization

Liu Bo (1):
  Btrfs: fix BUG_ON in btrfs_mark_buffer_dirty

Robbie Ko (3):
  Btrfs: fix enospc in hole punching
  Btrfs: fix deadlock caused by fsync when logging directory entries
  Btrfs: fix tree search logic when replaying directory entry deletes

 fs/btrfs/delayed-ref.h |  6 --
 fs/btrfs/disk-io.c | 23 +++
 fs/btrfs/file.c|  4 ++--
 fs/btrfs/qgroup.c  |  5 +
 fs/btrfs/relocation.c  | 34 --
 fs/btrfs/tree-log.c|  7 +++
 6 files changed, 37 insertions(+), 42 deletions(-)

-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs corruption fix and a couple cleanups

2016-11-23 Thread fdmanana
From: Filipe Manana 

Hi Chris,

Here follows two cleanups and a fix for an issue that leads to a logical
corruption in the extent tree, where we end up with file extent items in
subvolume trees that don't have a matching extent item and back reference
in the extent tree after a balance when qgroups are enabled. This is a
regression introduced in 4.7 by a fix for yet another regression caused
by the last qgroups rework. This has been hitting SLE and openSUSE users
and QA very badly, where transactions keep getting aborted when running
delayed references leaving the root filesystem in RO mode and nearly
unusable. If you think it's appropriate, please consider it for
the 4.9 kernel (I've also tagged it for stable).
And of course, the two cleanups can wait for the 4.10 merge window.

Thanks.

The following changes since commit e3597e6090ddf40904dce6d0a5a404e2c490cac6:

  Merge branch 'for-4.9-rc3' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.9 
(2016-11-01 12:54:45 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
for-chris-4.10

for you to fetch changes up to 2a2a83de548f7afe2c27e51cbc9ff761cba2b61b:

  Btrfs: remove rb_node field from the delayed ref node structure (2016-11-19 
13:39:18 +)


Filipe Manana (3):
  Btrfs: fix relocation incorrectly dropping data references
  Btrfs: remove unused code when creating and merging reloc trees
  Btrfs: remove rb_node field from the delayed ref node structure

 fs/btrfs/delayed-ref.h |  6 --
 fs/btrfs/relocation.c  | 34 --
 2 files changed, 12 insertions(+), 28 deletions(-)

-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-11-04 Thread Chris Mason
Hi Linus,

My for-linus-4.9 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.9

Has some fixes that Dave Sterba collected.  We held off on these last 
week because I was focused on the memory corruption testing.

I had asked you about pulling this directly from Dave, and you can skip
my merge commit here:

git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.9-rc3

I'll probably have the merge commit when I nail down a fix for the crash 
Dave Jones triggered with trinity, but wanted to let you pick.

Wang Xiaoguang (3) commits (+10/-2):
 btrfs: pass correct args to btrfs_async_run_delayed_refs() (+2/-2)
 btrfs: fix WARNING in btrfs_select_ref_head() (+3/-0)
 btrfs: make file clone aware of fatal signals (+5/-0)

Dan Carpenter (1) commits (+4/-4):
 Btrfs: remove some no-op casts

Liu Bo (1) commits (+8/-1):
 Btrfs: kill BUG_ON in do_relocation

Goldwyn Rodrigues (1) commits (+7/-2):
 btrfs: qgroup: Prevent qgroup->reserved from going subzero

Total: (6) commits (+29/-9)

  fs/btrfs/extent-tree.c |  3 +++
  fs/btrfs/extent_io.c   |  8 
  fs/btrfs/inode.c   | 13 +
  fs/btrfs/ioctl.c   |  5 +
  fs/btrfs/relocation.c  |  9 -
  5 files changed, 29 insertions(+), 9 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-10-28 Thread Chris Mason
Hi Linus,

My for-linus-4.9 has two fixes in it:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.9

My patch fixes the btrfs list_head abuse that we tracked down during
Dave Jones' memory corruption investigation.  With both Jens and my
patches in place, I'm no longer able to trigger problems.

Filipe is fixing a difficult old bug between snapshots, balance and
send.  Dave is cooking a few more for the next rc, but these are tested
and ready:

Chris Mason (1) commits (+6/-14):
btrfs: fix races on root_log_ctx lists

Filipe Manana (1) commits (+58/-0):
Btrfs: fix incremental send failure caused by balance

Total: (2) commits (+64/-14)

 fs/btrfs/send.c | 58 +
 fs/btrfs/tree-log.c | 20 ++
 2 files changed, 64 insertions(+), 14 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-10-14 Thread Chris Mason
Hi Linus,

My for-linus-4.9 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.9

Has some fixes from Omar and Dave Sterba for our new free space tree.
This isn't heavily used yet, but as we move toward making it the new
default we wanted to nail down an endian bug.

Omar Sandoval (5) commits (+259/-145):
Btrfs: expand free space tree sanity tests to catch endianness bug (+96/-68)
Btrfs: fix extent buffer bitmap tests on big-endian systems (+51/-36)
Btrfs: fix free space tree bitmaps on big-endian systems (+76/-27)
Btrfs: fix mount -o clear_cache,space_cache=v2 (+12/-12)
Btrfs: catch invalid free space trees (+24/-2)

David Sterba (2) commits (+13/-12):
btrfs: tests: uninline member definitions in free_space_extent (+2/-1)
btrfs: tests: constify free space extent specs (+11/-11)

Total: (7) commits (+272/-157)

 fs/btrfs/ctree.h   |   3 +-
 fs/btrfs/disk-io.c |  33 +++---
 fs/btrfs/extent_io.c   |  64 +++
 fs/btrfs/extent_io.h   |  22 
 fs/btrfs/free-space-tree.c |  19 ++--
 fs/btrfs/tests/extent-io-tests.c   |  87 ---
 fs/btrfs/tests/free-space-tree-tests.c | 189 +++--
 include/uapi/linux/btrfs.h |  12 ++-
 8 files changed, 272 insertions(+), 157 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-10-11 Thread Chris Mason
Hi Linus,

My for-linus-4.9 has our merge window pull:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.9

This is later than normal because I was tracking down a use-after-free
during btrfs/101 in xfstests.  I had hoped to fix up the offending
patch, but wasn't happy with the size of the changes at this point in
the merge window.

The use-after-free was enough of a corner case that I didn't want to
rebase things out at this point.  So instead the top of the pull is my
revert, and the rest of these were prepped by Dave Sterba (thanks Dave!).  

This is a big variety of fixes and cleanups.  Liu Bo continues to fixup
fuzzer related problems, and some of Josef's cleanups are prep for his
bigger extent buffer changes (slated for v4.10).

Liu Bo (13) commits (+207/-36):
Btrfs: remove unnecessary btrfs_mark_buffer_dirty in split_leaf (+5/-1)
Btrfs: return gracefully from balance if fs tree is corrupted (+17/-6)
Btrfs: improve check_node to avoid reading corrupted nodes (+28/-4)
Btrfs: add error handling for extent buffer in print tree (+7/-0)
Btrfs: memset to avoid stale content in btree node block (+11/-0)
Btrfs: bail out if block group has different mixed flag (+14/-0)
Btrfs: memset to avoid stale content in btree leaf (+28/-19)
Btrfs: fix memory leak in reading btree blocks (+9/-0)
Btrfs: fix memory leak of block group cache (+75/-0)
Btrfs: kill BUG_ON in run_delayed_tree_ref (+7/-1)
Btrfs: remove BUG_ON in start_transaction (+1/-4)
Btrfs: fix memory leak in do_walk_down (+1/-0)
Btrfs: remove BUG() in raid56 (+4/-1)

Jeff Mahoney (7) commits (+849/-902):
btrfs: btrfs_debug should consume fs_info when DEBUG is not defined (+10/-4)
btrfs: clean the old superblocks before freeing the device (+11/-27)
btrfs: convert send's verbose_printk to btrfs_debug (+38/-27)
btrfs: convert printk(KERN_* to use pr_* calls (+205/-275)
btrfs: convert pr_* to btrfs_* where possible (+231/-177)
btrfs: unsplit printed strings (+324/-391)
btrfs: add dynamic debug support (+30/-1)

Josef Bacik (5) commits (+178/-156):
Btrfs: kill the start argument to read_extent_buffer_pages (+15/-28)
Btrfs: kill BUG_ON()'s in btrfs_mark_extent_written (+33/-8)
Btrfs: add a flags field to btrfs_fs_info (+99/-109)
Btrfs: don't leak reloc root nodes on error (+4/-0)
Btrfs: don't BUG() during drop snapshot (+27/-11)

Goldwyn Rodrigues (3) commits (+3/-18):
btrfs: Do not reassign count in btrfs_run_delayed_refs (+0/-1)
btrfs: Remove already completed TODO comment (+0/-2)
btrfs: parent_start initialization cleanup (+3/-15)

Luis Henriques (2) commits (+0/-4):
btrfs: Fix warning "variable ‘blocksize’ set but not used" (+0/-2)
btrfs: Fix warning "variable ‘gen’ set but not used" (+0/-2)

Eric Sandeen (1) commits (+1/-1):
btrfs: fix perms on demonstration debugfs interface

Anand Jain (1) commits (+20/-6):
btrfs: fix a possible umount deadlock

Lu Fengqi (1) commits (+369/-10):
btrfs: fix check_shared for fiemap ioctl

Chris Mason (1) commits (+15/-11):
Revert "btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs"

Masahiro Yamada (1) commits (+8/-28):
btrfs: squash lines for simple wrapper functions

Qu Wenruo (1) commits (+37/-25):
btrfs: extend btrfs_set_extent_delalloc and its friends to support in-band 
dedupe and subpage size patchset

Arnd Bergmann (1) commits (+7/-10):
btrfs: fix btrfs_no_printk stub helper

David Sterba (1) commits (+9/-0):
btrfs: create example debugfs file only in debugging build

Naohiro Aota (1) commits (+11/-15):
btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

Total: (39) commits (+1714/-1222)

 fs/btrfs/backref.c| 409 ++
 fs/btrfs/btrfs_inode.h|  11 --
 fs/btrfs/check-integrity.c| 342 +++
 fs/btrfs/compression.c|   6 +-
 fs/btrfs/ctree.c  |  56 ++
 fs/btrfs/ctree.h  | 116 
 fs/btrfs/delayed-inode.c  |  25 ++-
 fs/btrfs/delayed-ref.c|  15 +-
 fs/btrfs/dev-replace.c|  21 ++-
 fs/btrfs/dir-item.c   |   7 +-
 fs/btrfs/disk-io.c| 237 
 fs/btrfs/disk-io.h|   2 +
 fs/btrfs/extent-tree.c| 198 +++-
 fs/btrfs/extent_io.c  | 170 +++---
 fs/btrfs/extent_io.h  |   4 +-
 fs/btrfs/file.c   |  43 -
 fs/btrfs/free-space-cache.c   |  21 ++-
 fs/btrfs/free-space-cache.h   |   6 +-
 fs/btrfs/free-space-tree.c|  20 ++-
 fs/btrfs/inode-map.c  |  31 ++--
 fs/btrfs/inode.c  |  70 +---
 fs/btrfs/ioctl.c  |  14 +-
 fs/btrfs/lzo.c|   6 +-
 fs/btrfs/ordered-data.c   |   4 +-
 fs/btrfs/print-tree.c |  93 +-
 fs/btrfs/qgroup.c |  77 
 fs/btrfs/raid56.c |   5 +-

[GIT PULL] Btrfs

2016-09-23 Thread Chris Mason
Hi Linus,

We have two fixes in my for-linus-4.8 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.8

Josef is fixing a problem when quotas are enabled with his latest ENOSPC
rework, and Jeff is adding more checks into the subvol ioctls to avoid
tripping up lookup_one_len

Josef Bacik (1) commits (+3/-6):
Btrfs: handle quota reserve failure properly

Jeff Mahoney (1) commits (+12/-0):
btrfs: ensure that file descriptor used with subvol ioctls is a dir

Total: (2) commits (+15/-6)

 fs/btrfs/extent-tree.c |  9 +++--
 fs/btrfs/ioctl.c   | 12 
 2 files changed, 15 insertions(+), 6 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-09-09 Thread Chris Mason
Hi Linus,

We have three fixes in my for-linus-4.8 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.8

I'm not proud of how long it took me to track down that one liner in
btrfs_sync_log(), but the good news is the patches I was trying to blame
for these problems were actually fine (sorry Filipe).

Wang Xiaoguang (2) commits (+16/-8):
btrfs: introduce tickets_id to determine whether asynchronous metadata 
reclaim work makes progress (+7/-5)
btrfs: do not decrease bytes_may_use when replaying extents (+9/-3)

Chris Mason (1) commits (+1/-0):
Btrfs: remove root_log_ctx from ctx list before btrfs_sync_log returns

Total: (3) commits (+17/-8)

 fs/btrfs/ctree.h   |  1 +
 fs/btrfs/extent-tree.c | 23 +++
 fs/btrfs/tree-log.c|  1 +
 3 files changed, 17 insertions(+), 8 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-09-03 Thread Chris Mason
Hi Linus,

We have a few small fixes queued up in my for-linus-4.8 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.8

I'm still prepping a set of fixes for btrfs fsync, just nailing
down a hard to trigger memory corruption.  For now, these are tested and
ready:

Josef Bacik (1) commits (+5/-3):
Btrfs: kill invalid ASSERT() in process_all_refs()

Liu Bo (1) commits (+5/-3):
Btrfs: fix endless loop in balancing block groups

Wang Xiaoguang (1) commits (+5/-5):
btrfs: fix one bug that process may endlessly wait for ticket in 
wait_reserve_ticket()

Total: (3) commits (+15/-11)

 fs/btrfs/extent-tree.c | 10 +-
 fs/btrfs/relocation.c  |  8 +---
 fs/btrfs/send.c|  8 +---
 3 files changed, 15 insertions(+), 11 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-08-26 Thread Chris Mason
Hi Linus,

Please pull my for-linus-4.8 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.8

We've queued up a few different fixes in here.  These range from enospc
corners to fsync and quota fixes, and a few targeted at
error handling for corrupt metadata/fuzzing.

Liu Bo (5) commits (+60/-2):
Btrfs: detect corruption when non-root leaf has zero item (+22/-1)
Btrfs: add ASSERT for block group's memory leak (+5/-0)
Btrfs: clarify do_chunk_alloc()'s return value (+9/-0)
Btrfs: fix memory leak of reloc_root (+8/-1)
Btrfs: check btree node's nritems (+16/-0)

Qu Wenruo (4) commits (+191/-53):
btrfs: relocation: Fix leaking qgroups numbers on data extents (+103/-6)
btrfs: qgroup: Fix qgroup incorrectness caused by log replay (+16/-0)
btrfs: qgroup: Refactor btrfs_qgroup_insert_dirty_extent() (+71/-47)
btrfs: backref: Fix soft lockup in __merge_refs function (+1/-0)

Wang Xiaoguang (4) commits (+161/-108):
btrfs: use correct offset for reloc_inode in prealloc_file_extent_cluster() 
(+6/-4)
btrfs: divide btrfs_update_reserved_bytes() into two functions (+57/-40)
btrfs: update btrfs_space_info's bytes_may_use timely (+73/-63)
btrfs: fix fsfreeze hang caused by delayed iputs deal (+25/-1)

Jeff Mahoney (3) commits (+45/-18):
btrfs: don't create or leak aliased root while cleaning up orphans (+22/-11)
btrfs: waiting on qgroup rescan should not always be interruptible (+13/-6)
btrfs: properly track when rescan worker is running (+10/-1)

Filipe Manana (1) commits (+8/-4):
Btrfs: fix lockdep warning on deadlock against an inode's log mutex

Anand Jain (1) commits (+19/-8):
btrfs: do not background blkdev_put()

Alex Lyakas (1) commits (+1/-1):
btrfs: flush_space: treat return value of do_chunk_alloc properly

Josef Bacik (1) commits (+1/-0):
Btrfs: fix em leak in find_first_block_group

Total: (20) commits

 fs/btrfs/backref.c |   1 +
 fs/btrfs/ctree.h   |   5 +-
 fs/btrfs/delayed-ref.c |   7 +-
 fs/btrfs/disk-io.c |  56 +--
 fs/btrfs/disk-io.h |   2 +
 fs/btrfs/extent-tree.c | 185 +++--
 fs/btrfs/extent_io.h   |   1 +
 fs/btrfs/file.c|  28 
 fs/btrfs/inode-map.c   |   3 +-
 fs/btrfs/inode.c   |  37 +++---
 fs/btrfs/ioctl.c   |   2 +-
 fs/btrfs/qgroup.c  |  62 ++---
 fs/btrfs/qgroup.h  |  36 --
 fs/btrfs/relocation.c  | 126 ++---
 fs/btrfs/root-tree.c   |  27 +---
 fs/btrfs/super.c   |  16 +
 fs/btrfs/transaction.c |   7 +-
 fs/btrfs/tree-log.c|  21 +-
 fs/btrfs/tree-log.h|   5 +-
 fs/btrfs/volumes.c |  27 +---
 20 files changed, 473 insertions(+), 181 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-08-10 Thread Chris Mason
Hi Linus,

My for-linus-4.8 branch has some fixes for btrfs send/recv and fsync
from Filipe and Robbie Ko:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.8

Bonus points to Filipe for already having xfstests in place for many of
these.

Filipe Manana (8) commits (+172/-52):
Btrfs: improve performance on fsync against new inode after rename/unlink 
(+95/-9)
Btrfs: send, avoid incorrect leaf accesses when sending utimes operations 
(+2/-0)
Btrfs: remove unused function btrfs_add_delayed_qgroup_reserve() (+0/-30)
Btrfs: be more precise on errors when getting an inode from disk (+18/-9)
Btrfs: incremental send, fix invalid paths for rename operations (+2/-1)
Btrfs: send, add missing error check for calls to path_loop() (+2/-0)
Btrfs: add missing check for writeback errors on fsync (+8/-0)
Btrfs: send, don't bug on inconsistent snapshots (+45/-3)

Robbie Ko (4) commits (+111/-7):
Btrfs: send, fix invalid leaf accesses due to incorrect utimes operations 
(+11/-1)
Btrfs: send, fix warning due to late freeing of orphan_dir_info structures 
(+4/-0)
Btrfs: send, fix failure to move directories with the same name around 
(+95/-5)
Btrfs: incremental send, fix premature rmdir operations (+1/-1)

Total: (12) commits (+283/-59)

 fs/btrfs/delayed-ref.c |  27 
 fs/btrfs/delayed-ref.h |   3 -
 fs/btrfs/file.c|   8 +++
 fs/btrfs/inode.c   |  46 ++---
 fs/btrfs/send.c| 173 +
 fs/btrfs/tree-log.c|  85 +---
 6 files changed, 283 insertions(+), 59 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-08-04 Thread Chris Mason
Hi Linus,

This is part two of my btrfs pull, which is some cleanups and a batch of
fixes.  

Most of the code here is from Jeff Mahoney, making the pointers
we pass around internally more consistent and less confusing overall.  I
noticed a small problem right before I sent this out yesterday, so I
fixed it up and re-tested overnight.

Please pull my for-linus-4.8 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.8

There are some minor conflicts against Mike Christie's changes in
your tree.  I've put the conflict resolution I used for testing here:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.8-merged

Jeff Mahoney (14) commits (+754/-669):
btrfs: tests, use BTRFS_FS_STATE_DUMMY_FS_INFO instead of dummy root 
(+19/-21)
btrfs: btrfs_relocate_chunk pass extent_root to btrfs_end_transaction 
(+1/-1)
btrfs: btrfs_test_opt and friends should take a btrfs_fs_info (+135/-130)
btrfs: cleanup, remove prototype for btrfs_find_root_ref (+0/-3)
btrfs: btrfs_abort_transaction, drop root parameter (+147/-152)
btrfs: convert nodesize macros to static inlines (+33/-15)
btrfs: tests, move initialization into tests/ (+48/-77)
btrfs: add btrfs_trans_handle->fs_info pointer (+6/-4)
btrfs: copy_to_sk drop unused root parameter (+2/-3)
btrfs: simpilify btrfs_subvol_inherit_props (+3/-3)
btrfs: prefix fsid to all trace events (+186/-158)
btrfs: tests, require fs_info for root (+103/-61)
btrfs: plumb fs_info into btrfs_work (+63/-31)
btrfs: introduce BTRFS_MAX_ITEM_SIZE (+8/-10)

Liu Bo (10) commits (+149/-49):
Btrfs: change BUG_ON()'s to ASSERT()'s in backref_cache_cleanup() (+6/-6)
Btrfs: error out if generic_bin_search get invalid arguments (+8/-0)
Btrfs: check inconsistence between chunk and block group (+16/-1)
Btrfs: fix unexpected balance crash due to BUG_ON (+24/-4)
Btrfs: fix eb memory leak due to readpage failure (+22/-3)
Btrfs: fix BUG_ON in btrfs_submit_compressed_write (+8/-2)
Btrfs: fix read_node_slot to return errors (+52/-21)
Btrfs: fix panic in balance due to EIO (+4/-0)
Btrfs: cleanup BUG_ON in merge_bio (+6/-3)
Btrfs: fix double free of fs root (+3/-9)

Nikolay Borisov (4) commits (+49/-20):
btrfs: Ratelimit "no csum found" info message (+1/-1)
btrfs: Handle uninitialised inode eviction (+8/-1)
btrfs: Add ratelimit to btrfs printing (+24/-2)
btrfs: Fix slab accounting flags (+16/-16)

Wang Xiaoguang (3) commits (+45/-13):
btrfs: expand cow_file_range() to support in-band dedup and 
subpage-blocksize (+41/-11)
btrfs: add missing bytes_readonly attribute file in sysfs (+2/-0)
btrfs: fix free space calculation in dump_space_info() (+2/-2)

Anand Jain (2) commits (+40/-36):
btrfs: make sure device is synced before return (+5/-0)
btrfs: reorg btrfs_close_one_device() (+35/-36)

David Sterba (2) commits (+4/-3):
btrfs: remove obsolete part of comment in statfs (+0/-3)
btrfs: hide test-only member under ifdef (+4/-0)

Ashish Samant (1) commits (+35/-37):
btrfs: Cleanup compress_file_range()

Chris Mason (1) commits (+3/-2):
Btrfs: fix __MAX_CSUM_ITEMS

Chandan Rajendra (1) commits (+1/-1):
Btrfs: subpage-blocksize: Rate limit scrub error message

Salah Triki (1) commits (+1/-2):
btrfs: Replace -ENOENT by -ERANGE in btrfs_get_acl()

Hans van Kranenburg (1) commits (+1/-1):
Btrfs: use the correct struct for BTRFS_IOC_LOGICAL_INO

Total: (40) commits (+1082/-833)

 fs/btrfs/acl.c |   3 +-
 fs/btrfs/async-thread.c|  31 +++-
 fs/btrfs/async-thread.h|   6 +-
 fs/btrfs/backref.c |   4 +-
 fs/btrfs/compression.c |  10 +-
 fs/btrfs/ctree.c   |  91 ++
 fs/btrfs/ctree.h   | 101 ++-
 fs/btrfs/dedupe.h  |  24 +++
 fs/btrfs/delayed-inode.c   |   4 +-
 fs/btrfs/delayed-ref.c |  17 +-
 fs/btrfs/dev-replace.c |   4 +-
 fs/btrfs/disk-io.c | 101 +--
 fs/btrfs/disk-io.h |   3 +-
 fs/btrfs/extent-tree.c | 124 --
 fs/btrfs/extent_io.c   |  30 +++-
 fs/btrfs/extent_map.c  |   2 +-
 fs/btrfs/file-item.c   |   4 +-
 fs/btrfs/file.c|  12 +-
 fs/btrfs/free-space-cache.c|   8 +-
 fs/btrfs/free-space-tree.c |  16 +-
 fs/btrfs/inode-map.c   |  16 +-
 fs/btrfs/inode.c   | 218 
 fs/btrfs/ioctl.c   |  40 ++---
 fs/btrfs/ordered-data.c|   2 +-
 fs/btrfs/props.c   |   6 +-
 fs/btrfs/qgroup.c  |  25 +--
 fs/btrfs/qgroup.h  |   9 +-
 fs/btrfs/relocation.c  |  20 ++-
 

Re: [GIT PULL] Btrfs fixes for 4.8

2016-08-03 Thread Chris Mason

On 08/03/2016 06:31 AM, fdman...@kernel.org wrote:

From: Filipe Manana 

Hi Chris,

Please consider the following small set of fixes for the 4.8 kernel.
These are mostly send fixes, some of them reported and sent by Robbie Ko a
long time ago, which I reviewed, updated (specially the change logs) and
tested. All of these already have test cases in xfstests. The rest are
just some fsync related fixes and a cleanup. These have all been sent to
the mailing list before and were rebased against your 'next' branch.


Thanks Filipe!  Since these are all fixes, I'll queue up for rc2.  My 
second rc1 pull will go out today.


-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.8

2016-08-03 Thread fdmanana
From: Filipe Manana 

Hi Chris,

Please consider the following small set of fixes for the 4.8 kernel.
These are mostly send fixes, some of them reported and sent by Robbie Ko a
long time ago, which I reviewed, updated (specially the change logs) and
tested. All of these already have test cases in xfstests. The rest are
just some fsync related fixes and a cleanup. These have all been sent to
the mailing list before and were rebased against your 'next' branch.

Thanks.

The following changes since commit 8b8b08cbfb9021af4b54b4175fc4c51d655aac8c:

  Btrfs: fix delalloc accounting after copy_from_user faults (2016-07-21 
04:03:40 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
integration-4.8

for you to fetch changes up to e6571499336e10f93a77c51a35fd1a96828eea71:

  Btrfs: remove unused function btrfs_add_delayed_qgroup_reserve() (2016-08-03 
11:02:51 +0100)


Filipe Manana (8):
  Btrfs: add missing check for writeback errors on fsync
  Btrfs: send, add missing error check for calls to path_loop()
  Btrfs: incremental send, fix invalid paths for rename operations
  Btrfs: send, avoid incorrect leaf accesses when sending utimes operations
  Btrfs: send, don't bug on inconsistent snapshots
  Btrfs: be more precise on errors when getting an inode from disk
  Btrfs: improve performance on fsync against new inode after rename/unlink
  Btrfs: remove unused function btrfs_add_delayed_qgroup_reserve()

Robbie Ko (4):
  Btrfs: send, fix failure to move directories with the same name around
  Btrfs: incremental send, fix premature rmdir operations
  Btrfs: send, fix warning due to late freeing of orphan_dir_info structures
  Btrfs: send, fix invalid leaf accesses due to incorrect utimes operations

 fs/btrfs/delayed-ref.c |  27 -
 fs/btrfs/delayed-ref.h |   3 ---
 fs/btrfs/file.c|   8 +++
 fs/btrfs/inode.c   |  46 
 fs/btrfs/send.c| 173 
+-
 fs/btrfs/tree-log.c|  85 
+++---
 6 files changed, 283 insertions(+), 59 deletions(-)

-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-07-31 Thread Chris Mason
Hi Linus,

This is part one of my btrfs pull, and you can find it in my
for-linus-4.8 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.8

This pull is dedicated to Josef's enospc rework, which we've been
testing for a few releases now.  It fixes some early enospc problems and
is dramatically faster.

The pull also includes an updated fix for the delalloc accounting that
happens after a fault in copy_from_user.   My patch in v4.7 was almost but
not quite enough.

Dave Sterba has a branch prepped with a cleanup series from Jeff Mahoney
as well as other fixes.  My plan is to send that after wading
through vacation backlog on Monday.

Josef Bacik (19) commits (+679/-344):
Btrfs: avoid deadlocks during reservations in btrfs_truncate_block (+5/-0)
Btrfs: use FLUSH_LIMIT for relocation in reserve_metadata_bytes (+22/-17)
Btrfs: don't bother kicking async if there's nothing to reclaim (+3/-0)
Btrfs: change delayed reservation fallback behavior (+23/-41)
Btrfs: always reserve metadata for delalloc extents (+13/-22)
Btrfs: change how we calculate the global block rsv (+9/-36)
Btrfs: add bytes_readonly to the spaceinfo at once (+11/-18)
Btrfs: introduce ticketed enospc infrastructure (+380/-151)
Btrfs: fill relocation block rsv after allocation (+6/-0)
Btrfs: fix delalloc reservation amount tracepoint (+3/-1)
Btrfs: fix release reserved extents trace points (+1/-5)
Btrfs: fix callers of btrfs_block_rsv_migrate (+18/-25)
Btrfs: always use trans->block_rsv for orphans (+7/-1)
Btrfs: use root when checking need_async_flush (+6/-5)
Btrfs: add tracepoint for adding block groups (+42/-0)
Btrfs: add tracepoints for flush events (+103/-10)
Btrfs: warn_on for unaccounted spaces (+8/-6)
Btrfs: add fsid to some tracepoints (+11/-6)
Btrfs: trace pinned extents (+8/-0)

Chris Mason (1) commits (+5/-7):
Btrfs: fix delalloc accounting after copy_from_user faults

Total: (20) commits (+684/-351)

 fs/btrfs/ctree.h |  15 +-
 fs/btrfs/delayed-inode.c |  68 ++--
 fs/btrfs/extent-tree.c   | 731 +++
 fs/btrfs/file.c  |  16 +-
 fs/btrfs/inode.c |   7 +-
 fs/btrfs/relocation.c|  45 +--
 include/trace/events/btrfs.h | 139 +++-
 7 files changed, 677 insertions(+), 344 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-06-10 Thread Chris Mason
Hi Linus

My for-linus-4.7 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.7

Has some fixes and some new self tests for btrfs.  The self tests are
usually disabled in the .config file (unless you're doing btrfs dev
work), and this bunch is meant to find problems with the 64K page
size patches.

Jeff has a patch to help people see if they are using the hardware
assist crc32c module, which really helps us nail down problems when
people ask why crcs are using so much CPU.

Otherwise, it's small fixes.

Feifei Xu (8) commits (+475/-361):
Btrfs: test_check_exists: Fix infinite loop when searching for free space 
entries (+2/-2)
Btrfs: self-tests: Execute page straddling test only when nodesize < 
PAGE_SIZE (+30/-19)
Btrfs: self-tests: Use macros instead of constants and add missing newline 
(+31/-18)
Btrfs: self-tests: Support testing all possible sectorsizes and nodesizes 
(+32/-22)
Btrfs: self-tests: Fix extent buffer bitmap test fail on BE system (+11/-1)
Btrfs: Fix integer overflow when calculating bytes_per_bitmap (+7/-7)
Btrfs: self-tests: Fix test_bitmaps fail on 64k sectorsize (+7/-1)
Btrfs: self-tests: Support non-4k page size (+355/-291)

Liu Bo (3) commits (+104/-15):
Btrfs: clear uptodate flags of pages in sys_array eb (+2/-0)
Btrfs: add validadtion checks for chunk loading (+67/-15)
Btrfs: add more validation checks for superblock (+35/-0)

Josef Bacik (1) commits (+1/-0):
Btrfs: end transaction if we abort when creating uuid root

Jeff Mahoney (1) commits (+9/-2):
btrfs: advertise which crc32c implementation is being used at module load

Vinson Lee (1) commits (+1/-1):
btrfs: Use __u64 in exported linux/btrfs.h.

Total: (14) commits (+590/-379)

 fs/btrfs/ctree.c   |   6 +-
 fs/btrfs/disk-io.c |  20 +-
 fs/btrfs/disk-io.h |   2 +-
 fs/btrfs/extent_io.c   |  10 +-
 fs/btrfs/extent_io.h   |   4 +-
 fs/btrfs/free-space-cache.c|  18 +-
 fs/btrfs/hash.c|   5 +
 fs/btrfs/hash.h|   1 +
 fs/btrfs/super.c   |  57 --
 fs/btrfs/tests/btrfs-tests.c   |   6 +-
 fs/btrfs/tests/btrfs-tests.h   |  27 +--
 fs/btrfs/tests/extent-buffer-tests.c   |  13 +-
 fs/btrfs/tests/extent-io-tests.c   |  86 ++---
 fs/btrfs/tests/free-space-tests.c  |  76 +---
 fs/btrfs/tests/free-space-tree-tests.c |  30 +--
 fs/btrfs/tests/inode-tests.c   | 344 ++---
 fs/btrfs/tests/qgroup-tests.c  | 111 ++-
 fs/btrfs/volumes.c | 109 +--
 include/uapi/linux/btrfs.h |   2 +-
 19 files changed, 569 insertions(+), 358 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-06-03 Thread Chris Mason
Hi Linus,

My for-linus-4.7 branch has some fixes:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.7

I realized as I was prepping this pull that my tip commit still had
Facebook task numbers and other internal metadata in it.  So I had to
reword the description, which is why it is only a few hours old.  Only
the description changed since testing.

The important part of this pull is Filipe's set of fixes for btrfs device
replacement.  Filipe fixed a few issues seen on the list and a number
he found on his own.

Filipe Manana (8) commits (+93/-19):
Btrfs: fix race setting block group back to RW mode during device replace 
(+5/-5)
Btrfs: fix unprotected assignment of the left cursor for device replace 
(+4/-0)
Btrfs: fix race setting block group readonly during device replace (+46/-2)
Btrfs: fix race between device replace and block group removal (+11/-0)
Btrfs: fix race between device replace and chunk allocation (+9/-12)
Btrfs: fix race between readahead and device replace/removal (+2/-0)
Btrfs: fix race between device replace and read repair (+10/-0)
Btrfs: fix race between device replace and discard (+6/-0)

Chris Mason (1) commits (+12/-1):
Btrfs: deal with duplciates during extent_map insertion in btrfs_get_extent

Total: (9) commits (+105/-20)

 fs/btrfs/extent-tree.c  |  6 ++
 fs/btrfs/extent_io.c| 10 ++
 fs/btrfs/inode.c| 13 -
 fs/btrfs/ordered-data.c |  6 +-
 fs/btrfs/ordered-data.h |  2 +-
 fs/btrfs/reada.c|  2 ++
 fs/btrfs/scrub.c| 50 ++---
 fs/btrfs/volumes.c  | 32 +++
 8 files changed, 103 insertions(+), 18 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-05-27 Thread Chris Mason
Hi Linus,

We have another round of fixes and a few cleanups in my for-linus-4.7
branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.7

I have a fix for short returns from btrfs_copy_from_user, which finally
nails down a very hard to find regression we added in v4.6.

Dave is pushing around gfp parameters, mostly to cleanup internal apis
and make it a little more consistent.  The rest are smaller fixes, and
one speelling fixup patch.

David Sterba (17) commits (+149/-116):
btrfs: make state preallocation more speculative in __set_extent_bit (+7/-1)
btrfs: make find_workspace warn if there are no workspaces (+14/-0)
btrfs: rename and document compression workspace members (+19/-16)
btrfs: sink gfp parameter to clear_record_extent_bits (+5/-8)
btrfs: sink gfp parameter to set_record_extent_bits (+4/-7)
btrfs: untangle gotos a bit in convert_extent_bit (+7/-9)
btrfs: untangle gotos a bit in __clear_extent_bit (+8/-8)
btrfs: sink gfp parameter to set_extent_delalloc (+6/-6)
btrfs: sink gfp parameter to clear_extent_bits (+15/-16)
btrfs: sink gfp parameter to convert_extent_bit (+8/-8)
btrfs: untangle gotos a bit in __set_extent_bit (+7/-8)
btrfs: sink gfp parameter to clear_extent_dirty (+4/-4)
btrfs: sink gfp parameter to set_extent_defrag (+3/-3)
btrfs: sink gfp parameter to set_extent_bits (+10/-11)
btrfs: sink gfp parameter to set_extent_new (+4/-3)
btrfs: make find_workspace always succeed (+12/-8)
btrfs: preallocate compression workspaces (+16/-0)

Liu Bo (2) commits (+7/-3):
Btrfs: fix unexpected return value of fiemap (+5/-1)
Btrfs: free sys_array eb as soon as possible (+2/-2)

Chris Mason (1) commits (+17/-10):
Btrfs: fix handling of faults from btrfs_copy_from_user

Zhao Lei (1) commits (+2/-1):
btrfs: scrub: Set bbio to NULL before calling btrfs_map_block

Nicholas D Steeves (1) commits (+106/-105):
btrfs: fix string and comment grammatical issues and typos

Total: (22) commits (+281/-235)

 fs/btrfs/backref.c|  2 +-
 fs/btrfs/btrfs_inode.h|  2 +-
 fs/btrfs/check-integrity.c|  2 +-
 fs/btrfs/ctree.c  | 14 +++---
 fs/btrfs/ctree.h  |  6 +--
 fs/btrfs/delayed-ref.h|  2 +-
 fs/btrfs/dev-replace.c|  2 +-
 fs/btrfs/disk-io.c| 14 +++---
 fs/btrfs/extent-tree.c| 48 ++--
 fs/btrfs/extent_io.c  | 94 ---
 fs/btrfs/extent_io.h  | 34 +++---
 fs/btrfs/extent_map.c |  2 +-
 fs/btrfs/file-item.c  |  2 +-
 fs/btrfs/file.c   | 31 -
 fs/btrfs/free-space-cache.c   |  2 +-
 fs/btrfs/free-space-cache.h   |  2 +-
 fs/btrfs/inode.c  | 27 ++-
 fs/btrfs/ioctl.c  | 12 ++---
 fs/btrfs/ordered-data.h   |  2 +-
 fs/btrfs/qgroup.c | 24 +-
 fs/btrfs/raid56.c |  6 +--
 fs/btrfs/relocation.c | 19 
 fs/btrfs/root-tree.c  |  4 +-
 fs/btrfs/scrub.c  | 11 ++---
 fs/btrfs/send.c   |  6 +--
 fs/btrfs/struct-funcs.c   |  2 +-
 fs/btrfs/super.c  |  8 ++--
 fs/btrfs/tests/extent-io-tests.c  | 10 ++---
 fs/btrfs/tests/free-space-tests.c |  7 +--
 fs/btrfs/tests/inode-tests.c  |  2 +-
 fs/btrfs/tests/qgroup-tests.c |  2 +-
 fs/btrfs/transaction.c|  2 +-
 fs/btrfs/transaction.h|  2 +-
 fs/btrfs/tree-log.c   | 10 ++---
 fs/btrfs/ulist.c  |  2 +-
 fs/btrfs/volumes.c| 12 ++---
 36 files changed, 219 insertions(+), 210 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-05-21 Thread Chris Mason
Hi Linus,

My for-linus-4.7 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.7

Has our merge window series of cleanups and fixes.  These target a wide
range of issues, but do include some important fixes for qgroups,
O_DIRECT, and fsync handling.   Jeff Mahoney moved around a few
definitions to make them easier for userland to consume.

Also whiteout support is included now that issues with overlayfs have
been cleared up.

I have one more fix pending for page faults during btrfs_copy_from_user,
but I wanted to get this bulk out the door first.

David Sterba (28) commits (+343/-247):
btrfs: introduce raid-type to error-code table, for minimum device 
constraint (+16/-1)
btrfs: switch to common message helpers in open_ctree, adjust messages 
(+50/-52)
btrfs: reuse existing variable in scrub_stripe, reduce stack usage (+9/-10)
btrfs: send: use vmalloc only as fallback for clone_sources_tmp (+8/-5)
btrfs: pass number of devices to btrfs_check_raid_min_devices (+20/-15)
btrfs: use dynamic allocation for root item in create_subvol (+37/-28)
btrfs: use existing device constraints table btrfs_raid_array (+9/-14)
btrfs: clone: use vmalloc only as fallback for nodesize bufer (+8/-5)
btrfs: send: use temporary variable to store allocation size (+8/-6)
btrfs: make find_workspace warn if there are no workspaces (+14/-0)
btrfs: rename and document compression workspace members (+19/-16)
btrfs: send: use vmalloc only as fallback for clone_roots (+7/-4)
btrfs: add read-only check to sysfs handler of features (+3/-0)
btrfs: send: use vmalloc only as fallback for read_buf (+7/-4)
btrfs: send: use vmalloc only as fallback for send_buf (+7/-4)
btrfs: ioctl: reorder exclusive op check in RM_DEV (+11/-12)
btrfs: ioctl: reorder exclusive op check in RM_DEV (+11/-12)
btrfs: add write protection to SET_FEATURES ioctl (+13/-3)
btrfs: kill unused writepage_io_hook callback (+16/-24)
btrfs: rename btrfs_find_device_by_user_input (+13/-10)
btrfs: build fixup for qgroup_account_snapshot (+5/-0)
btrfs: sysfs: protect reading label by lock (+7/-1)
btrfs: make find_workspace always succeed (+12/-8)
btrfs: preallocate compression workspaces (+16/-0)
btrfs: add check to sysfs handler of label (+3/-0)
btrfs: rename __check_raid_min_devices (+2/-2)
btrfs: GFP_NOFS does not GFP_HIGHMEM (+4/-4)
btrfs: rename flags for vol args v2 (+8/-7)

Anand Jain (20) commits (+449/-381):
btrfs: fix lock dep warning, move scratch dev out of device_list_mutex and 
uuid_mutex (+12/-5)
btrfs: fix lock dep warning move scratch super outside of chunk_mutex 
(+5/-4)
btrfs: make use of btrfs_scratch_superblocks() in btrfs_rm_device() 
(+13/-64)
btrfs: enhance btrfs_find_device_by_user_input() to check device path 
(+3/-4)
btrfs: cleanup assigning next active device with a check (+48/-22)
btrfs: create helper function __check_raid_min_devices() (+32/-19)
btrfs: create helper btrfs_find_device_by_user_input() (+23/-23)
btrfs: clean up and optimize __check_raid_min_device() (+19/-24)
btrfs: create a helper function to read the disk super (+52/-35)
btrfs: rename btrfs_std_error to btrfs_handle_fs_error (+31/-31)
btrfs: pass the right error code to the btrfs_std_error (+2/-2)
btrfs: make use of btrfs_find_device_by_user_input() (+37/-63)
btrfs: move error handling code together in ctree.h (+40/-38)
btrfs: refactor btrfs_dev_replace_start for reuse (+41/-23)
btrfs: s_bdev is not null after missing replace (+6/-3)
btrfs: remove unused function btrfs_assert() (+0/-1)
btrfs: introduce device delete by devid (+73/-5)
btrfs: optimize check for stale device (+2/-1)
btrfs: remove save_error_info() (+6/-10)
btrfs: use fs_info directly (+4/-4)

Filipe Manana (13) commits (+404/-180):
Btrfs: fix race between fsync and direct IO writes for prealloc extents 
(+37/-6)
Btrfs: fix empty symlink after creating symlink and fsync parent dir (+1/-1)
Btrfs: add semaphore to synchronize direct IO writes with fsync (+77/-118)
Btrfs: fix inode leak on failure to setup whiteout inode in rename (+6/-6)
Btrfs: fix for incorrect directory entries after fsync log replay (+8/-5)
Btrfs: fix race between block group relocation and nocow writes (+81/-1)
Btrfs: fix number of transaction units for renames with whiteout (+8/-1)
Btrfs: don't wait for unrelated IO to finish before relocation (+38/-19)
Btrfs: pin logs earlier when doing a rename exchange operation (+4/-4)
Btrfs: don't do unnecessary delalloc flushes when relocating (+79/-7)
Btrfs: unpin logs if rename exchange operation fails (+36/-2)
Btrfs: unpin log if rename operation fails (+27/-1)
Btrfs: pin log earlier when renaming (+2/-9)

Jeff Mahoney (8) commits (+1161/-1090):
btrfs: uapi/linux/btrfs.h migration, move struct 
btrfs_ioctl_defrag_range_args 

[GIT PULL] Btrfs fixes for 4.7

2016-05-13 Thread fdmanana
From: Filipe Manana 

Hi Chris,

Please consider the following changes for the merge window for 4.7.
There's an implementation for the rename exchange and rename whiteout
operations, from Dan Fuhry, which was originally in David's integration
branches and linux-next but then we agreed to move it into my branches
since I made a few fixes on top of it. Other than that, there's just the
usual set of bug fixes, in particular races between direct IO writes and
fsync and between direct IO writes and balance, which lead to data loss
and metadata corruption issues.
These were recently rebased just to add Reviewed-by tags from Josef and
Liu Bo, but otherwise unchanged and have been in testing for quite some
time here.

Thanks.

The following changes since commit 44549e8f5eea4e0a41b487b63e616cb089922b99:

  Linux 4.6-rc7 (2016-05-08 14:38:32 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git for-chris-4.7

for you to fetch changes up to 5f9a8a51d8b95505d8de8b7191ae2ed8c504d4af:

  Btrfs: add semaphore to synchronize direct IO writes with fsync (2016-05-13 
01:59:36 +0100)


Dan Fuhry (1):
  btrfs: add support for RENAME_EXCHANGE and RENAME_WHITEOUT

Filipe Manana (13):
  Btrfs: fix for incorrect directory entries after fsync log replay
  Btrfs: fix empty symlink after creating symlink and fsync parent dir
  Btrfs: don't wait for unrelated IO to finish before relocation
  Btrfs: don't do unnecessary delalloc flushes when relocating
  Btrfs: unpin log if rename operation fails
  Btrfs: pin log earlier when renaming
  Btrfs: fix inode leak on failure to setup whiteout inode in rename
  Btrfs: unpin logs if rename exchange operation fails
  Btrfs: pin logs earlier when doing a rename exchange operation
  Btrfs: fix number of transaction units for renames with whiteout
  Btrfs: fix race between fsync and direct IO writes for prealloc extents
  Btrfs: fix race between block group relocation and nocow writes
  Btrfs: add semaphore to synchronize direct IO writes with fsync

 fs/btrfs/btrfs_inode.h  |  10 +++
 fs/btrfs/ctree.h|  27 
 fs/btrfs/dev-replace.c  |   4 +-
 fs/btrfs/extent-tree.c  | 122 +--
 fs/btrfs/inode.c| 464 
+++---
 fs/btrfs/ioctl.c|   2 +-
 fs/btrfs/ordered-data.c |  26 +---
 fs/btrfs/ordered-data.h |   6 +-
 fs/btrfs/relocation.c   |  11 ++--
 fs/btrfs/super.c|   2 +-
 fs/btrfs/transaction.c  |   2 +-
 fs/btrfs/tree-log.c |  66 +++
 12 files changed, 608 insertions(+), 134 deletions(-)
-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-04-08 Thread Chris Mason
Hi Linus

We have some fixes queued up in my for-linus-4.6 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.6

These are bug fixes, including a really old fsync bug, and a few
trace points to help us track down problems in the quota code.

Mark Fasheh (2) commits (+129/-23):
btrfs: handle non-fatal errors in btrfs_qgroup_inherit() (+32/-22)
btrfs: Add qgroup tracing (+97/-1)

Filipe Manana (1) commits (+137/-0):
Btrfs: fix file/data loss caused by fsync after rename and new inode

Liu Bo (1) commits (+1/-0):
Btrfs: fix invalid reference in replace_path

Yauhen Kharuzhy (1) commits (+2/-0):
btrfs: Reset IO error counters before start of device replacing

Qu Wenruo (1) commits (+19/-2):
btrfs: Output more info for enospc_debug mount option

Davide Italiano (1) commits (+6/-3):
Btrfs: Improve FL_KEEP_SIZE handling in fallocate

Josef Bacik (1) commits (+1/-1):
Btrfs: don't use src fd for printk

David Sterba (1) commits (+8/-4):
btrfs: fallback to vmalloc in btrfs_compare_tree

Total: (9) commits (+303/-33)

 fs/btrfs/ctree.c |  12 ++--
 fs/btrfs/dev-replace.c   |   2 +
 fs/btrfs/extent-tree.c   |  21 ++-
 fs/btrfs/file.c  |   9 ++-
 fs/btrfs/ioctl.c |   2 +-
 fs/btrfs/qgroup.c|  63 +---
 fs/btrfs/relocation.c|   1 +
 fs/btrfs/tree-log.c  | 137 +++
 include/trace/events/btrfs.h |  89 +++-
 9 files changed, 303 insertions(+), 33 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-04-01 Thread Chris Mason
Hi Linus,

My for-linus-4.6 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.6

Has a few fixes Dave Sterba had queued up.  These are all pretty small,
but since they were tested I decided against waiting for more:

Alex Lyakas (2) commits (+18/-10):
btrfs: do not write corrupted metadata blocks to disk (+13/-2)
btrfs: csum_tree_block: return proper errno value (+5/-8)

Jiri Kosina (2) commits (+7/-10):
btrfs: cleaner_kthread() doesn't need explicit freeze (+1/-1)
btrfs: transaction_kthread() is not freezable (+6/-9)

Total: (4) commits (+25/-20)

 fs/btrfs/disk-io.c | 45 +
 1 file changed, 25 insertions(+), 20 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs file/data loss bug fix

2016-03-31 Thread fdmanana
From: Filipe Manana 

Hi Chris,

Please consider the following fix for the linux kernel 4.6 release. It is
not a regression in the code for 4.6 nor introduced in any recent release,
it's a problem that's been around for a long time (years). But since it's
a quite serious one, it's important in my opinion to get the fix into 4.6
(and to the stable releases) instead of waiting for the 4.7 merge window.
Three test cases were sent upstream for xfstests.

Thanks.

The following changes since commit 232cad8413a0bfbd25f11cc19fd13dfd85e1d8ad:

  Merge branch 'misc-4.6' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.6 
(2016-03-24 17:36:13 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git for-chris-4.6

for you to fetch changes up to 3943609915b333dd6c69ea2993e4c717da07ad46:

  Btrfs: fix file/data loss caused by fsync after rename and new inode 
(2016-03-30 23:39:06 +0100)


Filipe Manana (1):
  Btrfs: fix file/data loss caused by fsync after rename and new inode

 fs/btrfs/tree-log.c | 137 
+
 1 file changed, 137 insertions(+)

-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs

2016-03-21 Thread Linus Torvalds
On Mon, Mar 21, 2016 at 7:24 PM, Chris Mason  wrote:
>
> Hmmm, rereading my answer I realized I didn't actually answer.  I really
> think this is fixed.  I left the warning only because I originally
> expected something much more exotic.

Ok. It's more that you said the top commit fixes a problem, and the
only case where the top commit makes a difference it will also do that
WARN_ON_ONCE.

But it's pulled, test-built, and pushed out now.

  Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs

2016-03-21 Thread Chris Mason
On Mon, Mar 21, 2016 at 10:15:33PM -0400, Chris Mason wrote:
> On Mon, Mar 21, 2016 at 06:16:54PM -0700, Linus Torvalds wrote:
> > On Mon, Mar 21, 2016 at 5:24 PM, Chris Mason  wrote:
> > >
> > > I waited an extra day to send this one out because I hit a crash late
> > > last week with CONFIG_DEBUG_PAGEALLOC enabled (fixed in the top commit).
> > 
> > Hmm. If that commit helps, it will spit out a warning.
> > 
> > So is it actually fixed, or just hacked around to the point where you
> > don't get a page fault?

Hmmm, rereading my answer I realized I didn't actually answer.  I really
think this is fixed.  I left the warning only because I originally
expected something much more exotic.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs

2016-03-21 Thread Chris Mason
On Mon, Mar 21, 2016 at 06:16:54PM -0700, Linus Torvalds wrote:
> On Mon, Mar 21, 2016 at 5:24 PM, Chris Mason  wrote:
> >
> > I waited an extra day to send this one out because I hit a crash late
> > last week with CONFIG_DEBUG_PAGEALLOC enabled (fixed in the top commit).
> 
> Hmm. If that commit helps, it will spit out a warning.
> 
> So is it actually fixed, or just hacked around to the point where you
> don't get a page fault?
> 
> That WARN_ON_ONCE kind of implies it's a "this happens, but we don't know 
> why".

Hi Linus,

while (bio_index < bio->bi_vcnt) {
count = find some crcs
...
while (count--) {
...
page_bytes_left -= root->sectorsize;
if (!page_bytes_left) {
bio_index++;
/*
 * make sure we're still inside the
 * bio before we update page_bytes_left
 */
if (bio_index >= bio->bi_vcnt) {
WARN_ON_ONCE(count);
goto done;
}
bvec++;
page_bytes_left = bvec->bv_len;
^ this was the line that crashed
  before
}

}
}

done:
cleanup;
return;

What should be happening here is we'll goto done when count is zero and
we've walked past the end of the bio.  IOW, both the outer and inner
loops are doing the right tests and the right math, but the inner loop
is improperly accessing a bogus bvec->bv_len because it didn't realize
the outer loop was now completely done.

I don't see a way for it to happen when count != 0, and I ran xfstests
on a few machines to try and triple check that.  If there are new bugs
hiding here, we'll have EIOs returned up to userland because this
function didn't properly fetch the crcs.  If anyone reported the EIOs,
they would send in the WARN_ON output too, so we'd know right away not
to blame their hardware.

I also ran for days with heavy read/write loads without seeing the crc
errors.  I didn't have the WARN_ON, or CONFIG_DEBUG_PAGEALLOC on that
box, but if other things were wrong, we'd have done a lot worse than poke
into bvec->bv_len, and the crc errors would have stopped the test.

-chris

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs

2016-03-21 Thread Linus Torvalds
On Mon, Mar 21, 2016 at 5:24 PM, Chris Mason  wrote:
>
> I waited an extra day to send this one out because I hit a crash late
> last week with CONFIG_DEBUG_PAGEALLOC enabled (fixed in the top commit).

Hmm. If that commit helps, it will spit out a warning.

So is it actually fixed, or just hacked around to the point where you
don't get a page fault?

That WARN_ON_ONCE kind of implies it's a "this happens, but we don't know why".

  Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-03-21 Thread Chris Mason
Hi Linus,

I waited an extra day to send this one out because I hit a crash late
last week with CONFIG_DEBUG_PAGEALLOC enabled (fixed in the top commit). 

Please pull my my for-linus-4.6 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.6

We have a good sized cleanup of our internal read ahead code, and the
first series of commits from Chandan to enable PAGE_SIZE > sectorsize

Otherwise, it's a normal series of cleanups and fixes, with many thanks
to Dave Sterba for doing most of the patch wrangling this time.

David Sterba (21) commits (+165/-364):
btrfs: remove error message from search ioctl for nonexistent tree (+0/-2)
btrfs: drop unused argument in btrfs_ioctl_get_supported_features (+4/-5)
btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls (+6/-2)
btrfs: extent same: use GFP_KERNEL for page array allocations (+2/-2)
Documentation: btrfs: remove usage specific information (+11/-263)
btrfs: introduce key type for persistent permanent items (+17/-3)
btrfs: introduce key type for persistent temporary items (+16/-0)
btrfs: let callers of btrfs_alloc_root pass gfp flags (+11/-10)
btrfs: teach print_leaf about temporary item subtypes (+11/-0)
btrfs: teach print_leaf about permanent item subtypes (+10/-2)
btrfs: switch dev stats item to the permanent item key (+8/-5)
btrfs: scrub: use GFP_KERNEL on the submission path (+14/-12)
btrfs: use proper type for failrec in extent_state (+16/-20)
btrfs: switch balance item to the temporary item key (+3/-3)
btrfs: switch to kcalloc in btrfs_cmp_data_prepare (+2/-2)
btrfs: device add and remove: use GFP_KERNEL (+5/-4)
btrfs: change max_inline default to 2048 (+1/-1)
btrfs: send: use GFP_KERNEL everywhere (+19/-19)
btrfs: reada: use GFP_KERNEL everywhere (+5/-5)
btrfs: fallocate: use GFP_KERNEL (+3/-3)
btrfs: readdir: use GFP_KERNEL (+1/-1)

Zhao Lei (18) commits (+168/-167):
btrfs: reada: Use fs_info instead of root in __readahead_hook's argument 
(+24/-25)
btrfs: reada: Jump into cleanup in direct way for __readahead_hook() 
(+21/-19)
btrfs: reada: reduce additional fs_info->reada_lock in reada_find_zone 
(+4/-8)
btrfs: reada: move reada_extent_put to place after __readahead_hook() 
(+2/-2)
btrfs: reada: ignore creating reada_extent for a non-existent device (+8/-9)
btrfs: reada: Pass reada_extent into __readahead_hook directly (+24/-21)
btrfs: reada: add all reachable mirrors into reada device list (+9/-11)
btrfs: reada: avoid undone reada extents in btrfs_reada_wait (+8/-1)
btrfs: reada: Add missed segment checking in reada_find_zone (+3/-1)
btrfs: reada: Move is_need_to_readahead contition earlier (+9/-11)
btrfs: reada: Remove level argument in severial functions (+6/-9)
btrfs: reada: simplify dev->reada_in_flight processing (+10/-18)
btrfs: reada: bypass adding extent when all zone failed (+5/-0)
btrfs: reada: Fix in-segment calculation for reada (+2/-2)
btrfs: Continue write in case of can_not_nocow (+17/-20)
btrfs: reada: Avoid many times of empty loop (+1/-1)
btrfs: reada: limit max works count (+12/-1)
btrfs: reada: Fix a debug code typo (+3/-8)

Chandan Rajendra (12) commits (+321/-165):
Btrfs: btrfs_ioctl_clone: Truncate complete page after performing clone 
operation (+3/-2)
Btrfs: __btrfs_buffered_write: Reserve/release extents aligned to block 
size (+33/-13)
Btrfs: btrfs_submit_direct_hook: Handle map_length < bio vector length 
(+17/-8)
Btrfs: Use (eb->start, seq) as search key for tree modification log 
(+17/-17)
Btrfs: Search for all ordered extents that could span across a page (+20/-8)
Btrfs: btrfs_page_mkwrite: Reserve space in sectorsized units (+30/-5)
Btrfs: Compute and look up csums based on sectorsized blocks (+59/-33)
Btrfs: Clean pte corresponding to page straddling i_size (+11/-3)
Btrfs: Direct I/O read: Work on sectorsized blocks (+75/-23)
Btrfs: fallocate: Work with sectorsized blocks (+55/-51)
Btrfs: Limit inline extents to root->sectorsize (+1/-1)
Btrfs: Fix block size returned to user space (+0/-1)

Filipe Manana (7) commits (+167/-43):
Btrfs: fix listxattrs not listing all xattrs packed in the same item 
(+41/-24)
Btrfs: do not collect ordered extents when logging that inode exists 
(+16/-1)
Btrfs: fix unreplayable log after snapshot delete + parent dir fsync 
(+20/-0)
Btrfs: fix file loss on log replay after renaming a file and fsync (+59/-12)
Btrfs: fix deadlock between direct IO reads and buffered writes (+23/-2)
Btrfs: fix extent_same allowing destination offset beyond i_size (+3/-0)
Btrfs: fix race when checking if we can skip fsync'ing an inode (+5/-4)

Josef Bacik (4) commits (+36/-17):
Btrfs: check reserved when deciding to background flush (+1/-1)
Btrfs: add transaction space reservation tracepoints (+5/-1)
Btrfs: change how we 

[GIT PULL] Btrfs

2016-03-04 Thread Chris Mason
Hi Linus,

We've got a fix in my for-linus-4.5 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.5

Filipe nailed down a problem where tree log replay would do some work
that orphan code wasn't expecting to be done yet, leading to BUG_ON.

Filipe Manana (1) commits (+9/-1):
Btrfs: fix loading of orphan roots leading to BUG_ON

Total: (1) commits (+9/-1)

 fs/btrfs/root-tree.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.6

2016-03-01 Thread Chris Mason
On Wed, Mar 02, 2016 at 09:24:46AM +0800, Qu Wenruo wrote:
> 
> 
> Chris Mason wrote on 2016/03/01 20:11 -0500:
> >On Wed, Mar 02, 2016 at 08:48:06AM +0800, Qu Wenruo wrote:
> >>
> >>
> >>Chris Mason wrote on 2016/03/01 11:06 -0500:
> >>>On Tue, Mar 01, 2016 at 10:20:26AM +0100, David Sterba wrote:
> Hi Chris,
> 
> On Fri, Feb 26, 2016 at 01:22:00PM +, fdman...@kernel.org wrote:
> >The following changes since commit 
> >0fcb760afa6103419800674e22fb7f4de1f9670b:
> >
> >   Merge branch 'for-next' of 
> > git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into 
> > for-linus-4.6 (2016-02-24 10:21:44 -0800)
> >
> >are available in the git repository at:
> >
> >   git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
> > integration-4.6
> >
> >for you to fetch changes up to 97c86c11a5cb9839609a9df195e998c3312e68b0:
> >
> >   Btrfs: do not collect ordered extents when logging that inode exists 
> > (2016-02-26 04:28:15 +)
> 
> Filipe's branch is based on some integration snapshot that contains the
> 'delete device by id' patchset that was removed from the 4.6 queue.
> 
> Your branch 'next' merges it back again through Filipe's tree, besides
> that the merge commits of the topic branches in my for-next appear
> twice. While the duplicated commits are only an esthetic issue, the
> extra branch bothers me.
> 
> I don't see a nice way how to avoid rebases in this cases. My suggestion
> is that Filipe rebases the branch on my for-chris that could have been
> an integration at some point.
> 
> As we're merging our branches that way for the first time I'd like to
> find the workflow also for the next dev cycles so I'm open to other
> suggestions.
> >>>
> >>>Ugh, thanks Dave I missed this.  I'll rebase Filipe on top of your
> >>>branch.  The easiest way to avoid it in general is to only base trees on
> >>>top of things already in Linus' tree.  If there are specific
> >>>dependencies we can work it out on a case by case basis, but the merge
> >>>conflicts are almost always trivial.
> >>>
> >>>-chris
> >>
> >>Although off-topic, but do we need to rebase all sent pull to the new
> >>integration-4.6?
> >
> >Unless there are huge conflicts, it's actually much easier to base
> >against a recent v4.5-rcN.  That way if we do have to rebase the
> >integration branch, it doesn't mess up your pull request.
> >
> >If there are small conflicts, I can just deal with them when I pull.
> >For bigger conflicts, I'll either rebase on top of integration as
> >individual patches, or ask for help ;)
> 
> Thanks for the tip.
> Seems git can handle them well. (yeah, no more patch bombing )

Please keep patch bombing ;)  It's the best way to get things reviewed.
Besides, if people didn't like email, they would have found different
jobs long ago ;)

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.6

2016-03-01 Thread Qu Wenruo



Chris Mason wrote on 2016/03/01 20:11 -0500:

On Wed, Mar 02, 2016 at 08:48:06AM +0800, Qu Wenruo wrote:



Chris Mason wrote on 2016/03/01 11:06 -0500:

On Tue, Mar 01, 2016 at 10:20:26AM +0100, David Sterba wrote:

Hi Chris,

On Fri, Feb 26, 2016 at 01:22:00PM +, fdman...@kernel.org wrote:

The following changes since commit 0fcb760afa6103419800674e22fb7f4de1f9670b:

   Merge branch 'for-next' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.6 
(2016-02-24 10:21:44 -0800)

are available in the git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
integration-4.6

for you to fetch changes up to 97c86c11a5cb9839609a9df195e998c3312e68b0:

   Btrfs: do not collect ordered extents when logging that inode exists 
(2016-02-26 04:28:15 +)


Filipe's branch is based on some integration snapshot that contains the
'delete device by id' patchset that was removed from the 4.6 queue.

Your branch 'next' merges it back again through Filipe's tree, besides
that the merge commits of the topic branches in my for-next appear
twice. While the duplicated commits are only an esthetic issue, the
extra branch bothers me.

I don't see a nice way how to avoid rebases in this cases. My suggestion
is that Filipe rebases the branch on my for-chris that could have been
an integration at some point.

As we're merging our branches that way for the first time I'd like to
find the workflow also for the next dev cycles so I'm open to other
suggestions.


Ugh, thanks Dave I missed this.  I'll rebase Filipe on top of your
branch.  The easiest way to avoid it in general is to only base trees on
top of things already in Linus' tree.  If there are specific
dependencies we can work it out on a case by case basis, but the merge
conflicts are almost always trivial.

-chris


Although off-topic, but do we need to rebase all sent pull to the new
integration-4.6?


Unless there are huge conflicts, it's actually much easier to base
against a recent v4.5-rcN.  That way if we do have to rebase the
integration branch, it doesn't mess up your pull request.

If there are small conflicts, I can just deal with them when I pull.
For bigger conflicts, I'll either rebase on top of integration as
individual patches, or ask for help ;)


Thanks for the tip.
Seems git can handle them well. (yeah, no more patch bombing )




Yes, I mean the in-band de-dup patchset. (If it is going to be merged)


For de-dup, I need to sit down and spend some more time reviewing it.  I
know it's taking a long time, but I want to make sure we get the disk
format right up front.  Lets target v4.7.


OK, I'll ensure no more modification to the existing patchset for easier 
review.


Although we will continue adding minor features like compression with 
dedup or ioctl improvement, so I'm afraid we'll continue bombing mail 
list with 20+ patches. :)


Thanks,
Qu


-chris





--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.6

2016-03-01 Thread Chris Mason
On Wed, Mar 02, 2016 at 08:48:06AM +0800, Qu Wenruo wrote:
> 
> 
> Chris Mason wrote on 2016/03/01 11:06 -0500:
> >On Tue, Mar 01, 2016 at 10:20:26AM +0100, David Sterba wrote:
> >>Hi Chris,
> >>
> >>On Fri, Feb 26, 2016 at 01:22:00PM +, fdman...@kernel.org wrote:
> >>>The following changes since commit 
> >>>0fcb760afa6103419800674e22fb7f4de1f9670b:
> >>>
> >>>   Merge branch 'for-next' of 
> >>> git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into 
> >>> for-linus-4.6 (2016-02-24 10:21:44 -0800)
> >>>
> >>>are available in the git repository at:
> >>>
> >>>   git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
> >>> integration-4.6
> >>>
> >>>for you to fetch changes up to 97c86c11a5cb9839609a9df195e998c3312e68b0:
> >>>
> >>>   Btrfs: do not collect ordered extents when logging that inode exists 
> >>> (2016-02-26 04:28:15 +)
> >>
> >>Filipe's branch is based on some integration snapshot that contains the
> >>'delete device by id' patchset that was removed from the 4.6 queue.
> >>
> >>Your branch 'next' merges it back again through Filipe's tree, besides
> >>that the merge commits of the topic branches in my for-next appear
> >>twice. While the duplicated commits are only an esthetic issue, the
> >>extra branch bothers me.
> >>
> >>I don't see a nice way how to avoid rebases in this cases. My suggestion
> >>is that Filipe rebases the branch on my for-chris that could have been
> >>an integration at some point.
> >>
> >>As we're merging our branches that way for the first time I'd like to
> >>find the workflow also for the next dev cycles so I'm open to other
> >>suggestions.
> >
> >Ugh, thanks Dave I missed this.  I'll rebase Filipe on top of your
> >branch.  The easiest way to avoid it in general is to only base trees on
> >top of things already in Linus' tree.  If there are specific
> >dependencies we can work it out on a case by case basis, but the merge
> >conflicts are almost always trivial.
> >
> >-chris
> 
> Although off-topic, but do we need to rebase all sent pull to the new
> integration-4.6?

Unless there are huge conflicts, it's actually much easier to base
against a recent v4.5-rcN.  That way if we do have to rebase the
integration branch, it doesn't mess up your pull request.

If there are small conflicts, I can just deal with them when I pull.
For bigger conflicts, I'll either rebase on top of integration as
individual patches, or ask for help ;)

> Yes, I mean the in-band de-dup patchset. (If it is going to be merged)

For de-dup, I need to sit down and spend some more time reviewing it.  I
know it's taking a long time, but I want to make sure we get the disk
format right up front.  Lets target v4.7.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.6

2016-03-01 Thread Qu Wenruo



Chris Mason wrote on 2016/03/01 11:06 -0500:

On Tue, Mar 01, 2016 at 10:20:26AM +0100, David Sterba wrote:

Hi Chris,

On Fri, Feb 26, 2016 at 01:22:00PM +, fdman...@kernel.org wrote:

The following changes since commit 0fcb760afa6103419800674e22fb7f4de1f9670b:

   Merge branch 'for-next' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.6 
(2016-02-24 10:21:44 -0800)

are available in the git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
integration-4.6

for you to fetch changes up to 97c86c11a5cb9839609a9df195e998c3312e68b0:

   Btrfs: do not collect ordered extents when logging that inode exists 
(2016-02-26 04:28:15 +)


Filipe's branch is based on some integration snapshot that contains the
'delete device by id' patchset that was removed from the 4.6 queue.

Your branch 'next' merges it back again through Filipe's tree, besides
that the merge commits of the topic branches in my for-next appear
twice. While the duplicated commits are only an esthetic issue, the
extra branch bothers me.

I don't see a nice way how to avoid rebases in this cases. My suggestion
is that Filipe rebases the branch on my for-chris that could have been
an integration at some point.

As we're merging our branches that way for the first time I'd like to
find the workflow also for the next dev cycles so I'm open to other
suggestions.


Ugh, thanks Dave I missed this.  I'll rebase Filipe on top of your
branch.  The easiest way to avoid it in general is to only base trees on
top of things already in Linus' tree.  If there are specific
dependencies we can work it out on a case by case basis, but the merge
conflicts are almost always trivial.

-chris


Although off-topic, but do we need to rebase all sent pull to the new 
integration-4.6?

Yes, I mean the in-band de-dup patchset. (If it is going to be merged)

Thanks,
Qu

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html





--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.6

2016-03-01 Thread Chris Mason
On Tue, Mar 01, 2016 at 10:20:26AM +0100, David Sterba wrote:
> Hi Chris,
> 
> On Fri, Feb 26, 2016 at 01:22:00PM +, fdman...@kernel.org wrote:
> > The following changes since commit 0fcb760afa6103419800674e22fb7f4de1f9670b:
> > 
> >   Merge branch 'for-next' of 
> > git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into 
> > for-linus-4.6 (2016-02-24 10:21:44 -0800)
> > 
> > are available in the git repository at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
> > integration-4.6
> > 
> > for you to fetch changes up to 97c86c11a5cb9839609a9df195e998c3312e68b0:
> > 
> >   Btrfs: do not collect ordered extents when logging that inode exists 
> > (2016-02-26 04:28:15 +)
> 
> Filipe's branch is based on some integration snapshot that contains the
> 'delete device by id' patchset that was removed from the 4.6 queue.
> 
> Your branch 'next' merges it back again through Filipe's tree, besides
> that the merge commits of the topic branches in my for-next appear
> twice. While the duplicated commits are only an esthetic issue, the
> extra branch bothers me.
> 
> I don't see a nice way how to avoid rebases in this cases. My suggestion
> is that Filipe rebases the branch on my for-chris that could have been
> an integration at some point.
> 
> As we're merging our branches that way for the first time I'd like to
> find the workflow also for the next dev cycles so I'm open to other
> suggestions.

Ugh, thanks Dave I missed this.  I'll rebase Filipe on top of your
branch.  The easiest way to avoid it in general is to only base trees on
top of things already in Linus' tree.  If there are specific
dependencies we can work it out on a case by case basis, but the merge
conflicts are almost always trivial.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] Btrfs fixes for 4.6

2016-03-01 Thread David Sterba
Hi Chris,

On Fri, Feb 26, 2016 at 01:22:00PM +, fdman...@kernel.org wrote:
> The following changes since commit 0fcb760afa6103419800674e22fb7f4de1f9670b:
> 
>   Merge branch 'for-next' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.6 
> (2016-02-24 10:21:44 -0800)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
> integration-4.6
> 
> for you to fetch changes up to 97c86c11a5cb9839609a9df195e998c3312e68b0:
> 
>   Btrfs: do not collect ordered extents when logging that inode exists 
> (2016-02-26 04:28:15 +)

Filipe's branch is based on some integration snapshot that contains the
'delete device by id' patchset that was removed from the 4.6 queue.

Your branch 'next' merges it back again through Filipe's tree, besides
that the merge commits of the topic branches in my for-next appear
twice. While the duplicated commits are only an esthetic issue, the
extra branch bothers me.

I don't see a nice way how to avoid rebases in this cases. My suggestion
is that Filipe rebases the branch on my for-chris that could have been
an integration at some point.

As we're merging our branches that way for the first time I'd like to
find the workflow also for the next dev cycles so I'm open to other
suggestions.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fixes for 4.6

2016-02-26 Thread fdmanana
From: Filipe Manana 

Hi Chris,

Please consider the following changes for the 4.6 kernel merge window.
Nothing particularly outstanding, just the usual sort of bug fixes.
These have all been sent to the mailing list before (I just changed in
my repo the changelog for the deadlock fix patch to fix a typo pointed
by Liu Bo, other than that it's exactly the same as the version sent to
the mailing list). Some xfstests for these were already merged upstream
and one more sent earlier this week (for the listxattrs issue) that is
not yet merged.

Thanks.

The following changes since commit 0fcb760afa6103419800674e22fb7f4de1f9670b:

  Merge branch 'for-next' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.6 
(2016-02-24 10:21:44 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git 
integration-4.6

for you to fetch changes up to 97c86c11a5cb9839609a9df195e998c3312e68b0:

  Btrfs: do not collect ordered extents when logging that inode exists 
(2016-02-26 04:28:15 +)


Filipe Manana (7):
  Btrfs: fix unreplayable log after snapshot delete + parent dir fsync
  Btrfs: fix file loss on log replay after renaming a file and fsync
  Btrfs: fix extent_same allowing destination offset beyond i_size
  Btrfs: fix deadlock between direct IO reads and buffered writes
  Btrfs: fix listxattrs not listing all xattrs packed in the same item
  Btrfs: fix race when checking if we can skip fsync'ing an inode
  Btrfs: do not collect ordered extents when logging that inode exists

 fs/btrfs/file.c |  9 +
 fs/btrfs/inode.c| 25 +++--
 fs/btrfs/ioctl.c|  6 ++
 fs/btrfs/tree-log.c | 99 
---
 fs/btrfs/tree-log.h |  2 ++
 fs/btrfs/xattr.c| 65 
+
 6 files changed, 165 insertions(+), 41 deletions(-)

-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-02-19 Thread Chris Mason
Hi Linus,

My for-linus-4.5 branch has a btrfs DIO error passing fix.  I know how
much you love DIO, so I'm going to suggest against reading it.  We'll
follow up with a patch to drop the error arg from dio_end_io in the
next merge window.

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.5

Filipe Manana (1) commits (+2/-0):
Btrfs: fix direct IO requests not reporting IO error to user space

Total: (1) commits (+2/-0)

 fs/btrfs/inode.c | 2 ++
 1 file changed, 2 insertions(+)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs fix for direct IO error reporting

2016-02-16 Thread fdmanana
From: Filipe Manana 

Hi Chris,

Please consider the following fix for an upcoming 4.5 release candidate.
It fixes a problem where if the bio for a direct IO request fails, we end
reporting success to userspace. For example, for a direct IO write of 64K,
if the block layer notifies us that an IO error happened with our bio, we
end up returning the value 64K to user space instead of -EIO, making the
application think that its write request succeeded.

This is reproducible with the new generic test cases in xfstests: 271,
272, 276 and 278 (which use dm's error target to simulate IO errors).

Thanks.

The following changes since commit bc4ef7592f657ae81b017207a1098817126ad4cb:

  btrfs: properly set the termination value of ctx->pos in readdir (2016-02-11 
07:01:59 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git for-chris-4.5

for you to fetch changes up to 1636d1d77ef4e01e57f706a4cae3371463896136:

  Btrfs: fix direct IO requests not reporting IO error to user space 
(2016-02-16 03:41:26 +)


Filipe Manana (1):
  Btrfs: fix direct IO requests not reporting IO error to user space

 fs/btrfs/inode.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] Btrfs

2016-02-12 Thread Chris Mason
Hi Linus,

Please pull my for-linus-4.5 branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
for-linus-4.5

This has a few fixes from Filipe, along with a readdir fix from Dave
that we've been testing for some time.

Filipe Manana (4) commits (+115/-68):
Btrfs: remove no longer used function extent_read_full_page_nolock() 
(+12/-42)
Btrfs: fix hang on extent buffer lock caused by the inode_paths ioctl 
(+6/-4)
Btrfs: fix page reading in extent_same ioctl leading to csum errors (+21/-8)
Btrfs: fix invalid page accesses in extent_same (dedup) ioctl (+76/-14)

David Sterba (1) commits (+16/-3):
btrfs: properly set the termination value of ctx->pos in readdir

Total: (5) commits (+131/-71)

 fs/btrfs/backref.c   |  10 ++--
 fs/btrfs/compression.c   |   6 +--
 fs/btrfs/delayed-inode.c |   3 +-
 fs/btrfs/delayed-inode.h |   2 +-
 fs/btrfs/extent_io.c |  45 +-
 fs/btrfs/extent_io.h |   3 --
 fs/btrfs/inode.c |  14 +-
 fs/btrfs/ioctl.c | 119 ++-
 8 files changed, 131 insertions(+), 71 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   3   4   5   >