[PATCH 1/2] btrfs: fix parent in memory total_devices after seed delete

2018-05-31 Thread Anand Jain
If in case of deleting the seed device the %cur_devices (seed) and the %fs_devices (parent) are different. Now, as the parent fs_devices::total_devices also maintains the total number of devices including the seed device, so decrement its in memory value for the successful seed delete as we do upda

[PATCH 2/2] btrfs: fix missing superblock update in the device delete commit transaction

2018-05-31 Thread Anand Jain
When a device is deleted the btrfs_super_block::number_devices is reduced by 1, but since we are do that after the last commit transaction for the device delete transaction, the update to btrfs_super_block::number_devices waits for the next commit/fsync transaction to make it to the disk. This can

[PATCH RFC] btrfs: scrub: Don't use inode pages for device replace

2018-05-31 Thread Qu Wenruo
[BUG] Btrfs can easily create compressed extent without checksum (even though it shouldn't), and if we then try to replace device containing such extent, the result device will contain all the uncompressed data instead of the compressed one. Leading to data corruption. [Cause] When handling compr

Re: [PATCH] Btrfs: checking for NULL instead of IS_ERR

2018-05-31 Thread David Sterba
On Thu, May 31, 2018 at 03:41:41PM +0900, Misono Tomohiro wrote: > David, could you apply this on top of my v7 patch in for-next tree? Done. -- 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:

Re: [PATCH 2/2] btrfs: Refactor running of delayed inode items during transaction commit

2018-05-31 Thread David Sterba
On Thu, May 31, 2018 at 12:32:03AM +0300, Nikolay Borisov wrote: > On 28.05.2018 19:12, David Sterba wrote: > > On Mon, May 28, 2018 at 03:26:58PM +0300, Nikolay Borisov wrote: > >> dmesg looks like: > >> [6.649213] WARNING: CPU: 0 PID: 2838 at fs/btrfs/transaction.c:303 > >> recor

Re: [PATCH v7 0/3] btrfs: Add three new unprivileged ioctls to allow normal users to call "sub list/show" etc.

2018-05-31 Thread David Sterba
On Mon, May 21, 2018 at 10:09:41AM +0900, Tomohiro Misono wrote: > changelog: > v6 -> v7 > - Rebase to current misc-next again > - Fix 1st patch where otime is wrongly set instead of ctime > - Add reviewed-by/tested-by tag > This adds three new unprivileged ioctls: > > 1st patch: > ioctl

Re: [PATCH v4.1b 2/3] btrfs: balance: add args info during start and resume

2018-05-31 Thread David Sterba
On Fri, May 25, 2018 at 11:05:47AM +0800, Anand Jain wrote: > Balance arg info is an important information to be reviewed for the > system audit. So this patch adds them to the kernel log. > > Example: > ->btrfs bal start -f -mprofiles=raid1,convert=single,soft > -dlimit=10..20,usage=50 /btrfs >

Re: [PATCH 1/2] btrfs: kill btrfs_write_inode

2018-05-31 Thread David Sterba
On Tue, May 29, 2018 at 12:17:42PM -0700, Omar Sandoval wrote: > On Mon, May 28, 2018 at 06:57:59PM +0200, David Sterba wrote: > > On Tue, May 22, 2018 at 01:47:22PM -0400, Josef Bacik wrote: > > > From: Josef Bacik > > > > > > We don't actually need this. It used to be in place for O_SYNC write

Re: [PATCH 00/11] Summer argument cleanup

2018-05-31 Thread David Sterba
On Mon, May 28, 2018 at 09:36:39AM +0300, Nikolay Borisov wrote: > Hello, > > Here is yet another series removing a bunch of extraneous argument. The > series > constitutes no functional changes. Some of the function actually have a > kernel > counterpart (btrfs_lookup_extent_info/clean_tree_

Re: [PATCH v2 0/3] btrfs-progs: check: verify symlinks with append/immutable flags

2018-05-31 Thread David Sterba
On Tue, May 15, 2018 at 09:33:21AM +0800, Su Yue wrote: > This patchset can be fetch from my github: > https://github.com/Damenly/btrfs-progs/commits/odd_inode_flags > It's based on devel. > > symlinks should never have append/immutable attributes. > This patchset enables btrfs check to verify suc

Re: [PATCH] btrfs-progs: Use symbolic names for read ahead behavior

2018-05-31 Thread David Sterba
On Thu, May 10, 2018 at 07:22:11PM +0300, Nikolay Borisov wrote: > Presently btrfs-progs haven't pulled the enum defining the symbolic > names of read ahead constants. This commit adds the enum and > simultaneously converts all usages to respective symbolic name. > No functional change, just making

Re: [PATCH 3/3] btrfs-progs: print-tree: Enhance btrfs_print_tree() check to avoid out-of-boundary memory access

2018-05-31 Thread David Sterba
On Thu, May 10, 2018 at 09:50:01AM +0800, Qu Wenruo wrote: > For btrfs_print_tree(), if nr_items is corrupted, it can easily go > beyond extent buffer boundary. > > Add extra nr_item check, and only print as many valid slots as possible. > > Signed-off-by: Qu Wenruo Applied, thanks. -- To unsub

Re: [PATCH] btrfs-progs: restore: fix mistake on overwrite_ok() if relative path is given

2018-05-31 Thread David Sterba
On Wed, Apr 18, 2018 at 03:12:15PM +0800, Ting-Chang wrote: > From: Ting-Chang Hou > > fstatat will return -1 with errno EBADF if path_name is relative path. > This caused an error of the return value of overwrite_ok(). > When restoring the subvolume to destination with relative path, > it will o

Re: [PATCH 0/1] btrfs-progs: dump-tree: allow -b multiple times

2018-05-31 Thread David Sterba
On Fri, Apr 06, 2018 at 02:12:01PM +0800, Qu Wenruo wrote: > Although just one patch, it needs the extent buffer cleanup code as > basis, so please fetch it from my github repo: > https://github.com/adam900710/btrfs-progs/tree/dump_tree_multi_blocks Could you please refresh the patch on a recent d

Re: [PATCH 0/2] btrfs-progs: ins: dump-tree: Small updates for extent tree output

2018-05-31 Thread David Sterba
On Wed, May 30, 2018 at 01:55:18PM +0900, Misono Tomohiro wrote: > Two small updates for extent tree to make output more human readable. > > Misono Tomohiro (2): > btrfs-progs: ins: dump-tree: Use %lld for extent data backref offset > btrfs-progs: ins: dump-tree: Print tree name for tree block

Re: [PATCH] btrfs-progs: Add DEBUG_CFLAGS_INTERNAL for libbtrfsutil

2018-05-31 Thread David Sterba
On Fri, May 18, 2018 at 05:41:08PM +0800, Gu Jinxiang wrote: > From: Gu JinXiang > > Add DEBUG_CFLAGS_INTERNAL to LIBBTRFSUTIL_CFLAGS for libbtrfsutil's > build. > > Signed-off-by: Gu JinXiang Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the bod

Re: [PATCH 0/9] Overhaul btrfs-corrupt-block

2018-05-31 Thread David Sterba
On Mon, May 14, 2018 at 02:13:25PM +0300, Nikolay Borisov wrote: > btrfs-corrupt-block is a very useful tool albeit very neglected. This series > aims to give it much needed attention. There is a mix of code-improvements > and > bug fixes. Code improvement mainly consists of factoring our duplic

Re: [PATCH] btrfs-progs: print-tree: remove dead code from btrfs_print_tree

2018-05-31 Thread David Sterba
On Mon, Apr 09, 2018 at 02:40:44PM +0800, Lu Fengqi wrote: > Since the out label has been deleted, this free_extent_buffer will never > be executed. > > Fixes: f37ae8d275c2 ("btrfs-progs: print-tree: Enhance warning on tree block > level mismatch and error handling") > Signed-off-by: Lu Fengqi

[josef-btrfs:blk-iolatency 7/13] include/linux/swap.h:641:20: error: two or more data types in declaration specifiers

2018-05-31 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git blk-iolatency head: 2a5cee452665b4531b9466ad61ea0e55d298ea8e commit: c7d786e9b482df1830ee7610678657d3ffd0c123 [7/13] memcontrol: schedule throttling if we are congested config: i386-randconfig-x008-201821 (attached as

[josef-btrfs:blk-iolatency 7/13] mm/memcontrol.c:5470: undefined reference to `mem_cgroup_throttle_swaprate'

2018-05-31 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git blk-iolatency head: 2a5cee452665b4531b9466ad61ea0e55d298ea8e commit: c7d786e9b482df1830ee7610678657d3ffd0c123 [7/13] memcontrol: schedule throttling if we are congested config: i386-randconfig-a0-201821 (attached as .c

Re: [PATCH 0/1] btrfs-progs: dump-tree: allow -b multiple times

2018-05-31 Thread Qu Wenruo
On 2018年05月31日 20:03, David Sterba wrote: > On Fri, Apr 06, 2018 at 02:12:01PM +0800, Qu Wenruo wrote: >> Although just one patch, it needs the extent buffer cleanup code as >> basis, so please fetch it from my github repo: >> https://github.com/adam900710/btrfs-progs/tree/dump_tree_multi_blocks

Re: [PATCH RFC] btrfs: scrub: Don't use inode pages for device replace

2018-05-31 Thread Jeff Mahoney
On 5/31/18 4:35 AM, Qu Wenruo wrote: > [BUG] > Btrfs can easily create compressed extent without checksum (even > though it shouldn't), and if we then try to replace device containing > such extent, the result device will contain all the uncompressed data > instead of the compressed one. > > Leadi

[PATCH] fstests: btrfs: Test if btrfs will corrupt nodatasum compressed extent when replacing device

2018-05-31 Thread Qu Wenruo
This is a long existing bug (from 2012) but exposed by a reporter recently, that when compressed extent without data csum get written to device-replace target device, the written data is in fact uncompressed data other than the original compressed data. And since btrfs still consider the data is c

Re: Any chance to get snapshot-aware defragmentation?

2018-05-31 Thread Zygo Blaxell
On Mon, May 21, 2018 at 11:38:28AM -0400, Austin S. Hemmelgarn wrote: > On 2018-05-21 09:42, Timofey Titovets wrote: > > пн, 21 мая 2018 г. в 16:16, Austin S. Hemmelgarn : > > > On 2018-05-19 04:54, Niccolò Belli wrote: > > > > On venerdì 18 maggio 2018 20:33:53 CEST, Austin S. Hemmelgarn wrote: >

[PATCH REBASED 1/1] btrfs-progs: inspect-dump-tree: Allow '-b|--block' to be specified multiple times

2018-05-31 Thread Qu Wenruo
Reuse extent-cache facility to record multiple bytenr so '-b|--block' can be specified multiple times. Despite that, add a sector size alignment check before we try to print a tree block. (Please note that, nodesize alignment check is not suitable here as meta chunk start bytenr could be unaligned

[PATCH REBASED 0/1] btrfs-progs: dump-tree: allow -b multiple times

2018-05-31 Thread Qu Wenruo
Although just one patch, it needs the extent buffer cleanup code as basis, so please fetch it from my github repo: https://github.com/adam900710/btrfs-progs/tree/dump_tree_multi_blocks It's based on David's devel branch, with HEAD as: commit ffc7e4f730bd5ec49ba14ae3a13576311d57d4a6 (david/devel) A

Re: [PATCH REBASED 1/1] btrfs-progs: inspect-dump-tree: Allow '-b|--block' to be specified multiple times

2018-05-31 Thread Nikolay Borisov
On 1.06.2018 08:15, Qu Wenruo wrote: > Reuse extent-cache facility to record multiple bytenr so '-b|--block' > can be specified multiple times. > > Despite that, add a sector size alignment check before we try to print a > tree block. > (Please note that, nodesize alignment check is not suitab