Re: [PATCH] Btrfs: fix NULL pointer dereference in log_dir_items

2018-04-01 Thread Nikolay Borisov
On 31.03.2018 01:11, Liu Bo wrote: > 0, 1 and <0 can be returned by btrfs_next_leaf(), and when <0 is > returned, path->nodes[0] could be NULL, log_dir_items lacks such a > check for <0 and we may run into a null pointer dereference panic. > > Signed-off-by: Liu Bo Reviewed-by: Nikolay Borisov

Re: [PATCH] Btrfs: bail out on error during replay_dir_deletes

2018-04-01 Thread Nikolay Borisov
On 31.03.2018 01:11, Liu Bo wrote: > If errors were returned by btrfs_next_leaf(), replay_dir_deletes needs > to bail out, otherwise @ret would be forced to be 0 after 'break;' and > the caller won't be aware of it. > > Signed-off-by: Liu Bo Reviewed-by: Nikolay Borisov This is also a long-s

Re: bug? fstrim only trims unallocated space, not unused in bg's

2018-04-01 Thread Qu Wenruo
On 2018年04月01日 11:28, Chris Murphy wrote: > On Mon, Nov 20, 2017 at 11:10 PM, Qu Wenruo wrote: >> >> >> On 2017年11月21日 13:58, Chris Murphy wrote: >>> On Mon, Nov 20, 2017 at 9:58 PM, Qu Wenruo wrote: On 2017年11月21日 12:49, Chris Murphy wrote: > On Mon, Nov 20, 2017 at 9:43 PM,

Re: [PATCH RESEND 1/2] btrfs: Enhance btrfs_trim_fs function to handle error better

2018-04-01 Thread Qu Wenruo
Gentle ping? The patch is small and (with its 2nd patch) should fix trim behavior inside block groups. Thanks, Qu On 2017年11月28日 15:08, Qu Wenruo wrote: > Function btrfs_trim_fs() doesn't handle errors in a consistent way, if > error happens when trimming existing block groups, it will skip the

Re: Status of RAID5/6

2018-04-01 Thread Chris Murphy
On Sat, Mar 31, 2018 at 9:45 PM, Zygo Blaxell wrote: > On Sat, Mar 31, 2018 at 04:34:58PM -0600, Chris Murphy wrote: >> Write hole happens on disk in Btrfs, but the ensuing corruption on >> rebuild is detected. Corrupt data never propagates. > > Data written with nodatasum or nodatacow is corrupt

Re: Status of RAID5/6

2018-04-01 Thread Chris Murphy
(I hate it when my palm rubs the trackpad and hits send prematurely...) On Sun, Apr 1, 2018 at 2:51 PM, Chris Murphy wrote: >> Users can run scrub immediately after _every_ unclean shutdown to >> reduce the risk of inconsistent parity and unrecoverable data should >> a disk fail later, but this

Re: bug? fstrim only trims unallocated space, not unused in bg's

2018-04-01 Thread Chris Murphy
[chris@f27h linux]$ git apply -v ~/RESEND-1-2-btrfs-Enhance-btrfs_trim_fs-function-to-handle-error-better.patch Checking patch fs/btrfs/extent-tree.c... Hunk #1 succeeded at 10942 (offset -6 lines). Hunk #2 succeeded at 10962 (offset -6 lines). Hunk #3 succeeded at 10974 (offset -6 lines). Hunk #4

[PATCH] btrfs-progs: mkfs rootdir: use lgetxattr() not to follow a symbolic link

2018-04-01 Thread Misono Tomohiro
mkfs-test 016 "rootdir-bad-symbolic-link" fails when selinux is enabled. This is because add_xattr_item() uses getxattr() and tries to follow a bad symbolic link for selinux item, which causes ENOENT error. The line above already uses llistxattr() for getting list of xattr in order not to follow a

Re: [PATCH] btrfs-progs: mkfs rootdir: use lgetxattr() not to follow a symbolic link

2018-04-01 Thread Qu Wenruo
On 2018年04月02日 09:59, Misono Tomohiro wrote: > mkfs-test 016 "rootdir-bad-symbolic-link" fails when selinux is enabled. > This is because add_xattr_item() uses getxattr() and tries to follow a > bad symbolic link for selinux item, which causes ENOENT error. > > The line above already uses llistx

[PATCH] btrfs-progs: Let function find_device to be consistent with kernel

2018-04-01 Thread Gu Jinxiang
Make find_device to be consistent with kernel according 35c70103a528 ("btrfs: refactor find_device helper") And, modify the compare condition from both devid and uuid to devid or devid and uuid according 8f18cf13396c ("Btrfs: Make the resizer work based on shrinking and growing devices") Signed-

Re: Status of RAID5/6

2018-04-01 Thread Zygo Blaxell
On Sun, Apr 01, 2018 at 03:11:04PM -0600, Chris Murphy wrote: > (I hate it when my palm rubs the trackpad and hits send prematurely...) > > > On Sun, Apr 1, 2018 at 2:51 PM, Chris Murphy wrote: > > >> Users can run scrub immediately after _every_ unclean shutdown to > >> reduce the risk of inco