[PATCH] printk: Remove no longer used LOG_PREFIX.

2019-02-22 Thread Tetsuo Handa
When commit 5becfb1df5ac8e49 ("kmsg: merge continuation records while printing") introduced LOG_PREFIX, we used KERN_DEFAULT etc. as a flag for setting LOG_PREFIX in order to tell whether to call cont_add() (i.e. whether to append the message to "struct cont"). But since commit 4bcc595ccd80decb ("

[PATCH v3] shared/298: Wire btrfs support in get_free_sectors

2019-02-22 Thread Nikolay Borisov
Add support for btrfs in shared/298. Achieve this by introducing 2 new awk scripts that parse relevant btrfs structures and print holes. Additionally modify the test to create larger - 3gb filesystem in the case of btrfs. This is needed so that distinct block groups are used for data and metadata.

[PATCH 5/5] btrfs: extent_io: Unify the return value of btrfs_clone_extent_buffer() with alloc_extent_buffer()

2019-02-22 Thread Qu Wenruo
The direct callers are: 1) qgroup_rescan_leaf() 2) btrfs_compare_trees() These two call sites are stubs. 3) tree_mod_log_rewind() 4) get_old_root() These two doesn't follow the name pattern *_extent_buffer(), thus we don't need to unify their return value. However for get_old_root(), a

[PATCH 0/5] Unify the return value of alloc/clone_extent_buffer()

2019-02-22 Thread Qu Wenruo
This patchset can be fetched from github: https://github.com/adam900710/linux/tree/cleanup_alloc_extent_buffer Which is based on v5.0-rc7 There are 5 extent buffer alloc functions in btrfs: __alloc_extent_buffer(); alloc_extent_buffer(); __alloc_dummy_extent_buffer(); alloc_dummy_extent_buffer();

[PATCH 3/5] btrfs: extent_io: Unify the return value of alloc_dummy_extent_buffer() with alloc_extent_buffer()

2019-02-22 Thread Qu Wenruo
All direct callers are: 1) tests/inode-tests.c 2) tests/extent-buffer-tests.c 3) tests/extent-io-tests.c These call sites are all stubs. 4) tree_mod_log_rewind() 5) get_old_root() These two call sites no longer follows the function name pattern *_extent_buffer(). So they are also consider

[PATCH 4/5] btrfs: extent_io: Unify the return value of alloc_test_extent_buffer() with alloc_extent_buffer()

2019-02-22 Thread Qu Wenruo
The function only get called in two locations: 1) free-space-tree-tests.c 2) qgroup-tests.c These call sites are stubs. 3) btrfs_find_create_tree_block() Since all existing btrfs_find_create_tree_block() callers handles the return value correctly, it's also a stub. So all alloc_test_exte

[PATCH 2/5] btrfs: extent_io: Unify the return value of __alloc_extent_buffer() with alloc_extent_buffer()

2019-02-22 Thread Qu Wenruo
Although __alloc_extent_buffer() shouldn't fail due to its __GFP_NOFAIL flag, to unify the return value type, let's pretend it will return PTR_ERR() and never return NULL. The direct callers are: 1) alloc_extent_buffer() It's the stub of the call chain, as the only caller is btrfs_find_creat

[PATCH 1/5] btrfs: extent_io: Add comment about the return value of alloc_extent_buffer()

2019-02-22 Thread Qu Wenruo
To inform later developers how to check the return value of it. Signed-off-by: Qu Wenruo --- fs/btrfs/extent_io.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 52abe4082680..b28a75546700 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btr

Re: [PATCH 3/4] Btrfs: check if destination root is read-only for deduplication

2019-02-22 Thread Filipe Manana
On Wed, Feb 20, 2019 at 5:17 PM Zygo Blaxell wrote: > > On Wed, Feb 20, 2019 at 04:54:09PM +, Filipe Manana wrote: > > On Wed, Feb 20, 2019 at 4:42 PM Zygo Blaxell > > wrote: > > > > > > On Thu, Jan 31, 2019 at 04:39:22PM +, Filipe Manana wrote: > > > > On Thu, Dec 13, 2018 at 4:08 PM Dav

Re: [PATCH] btrfs: zstd ensure reclaim timer is properly cleaned up

2019-02-22 Thread Nikolay Borisov
On 21.02.19 г. 22:25 ч., Dennis Zhou wrote: > The timer function, zstd_reclaim_timer_fn(), reschedules itself under > certain conditions. Switch to del_timer_sync() to ensure that the timer > function hasn't rescheduled itself. According to del_timer_sync it just waits for any concurrent invoca

Re: [PATCH 5/5] btrfs: extent_io: Unify the return value of btrfs_clone_extent_buffer() with alloc_extent_buffer()

2019-02-22 Thread Nikolay Borisov
On 22.02.19 г. 12:16 ч., Qu Wenruo wrote: > The direct callers are: > 1) qgroup_rescan_leaf() > 2) btrfs_compare_trees() >These two call sites are stubs. > > 3) tree_mod_log_rewind() > 4) get_old_root() >These two doesn't follow the name pattern *_extent_buffer(), thus we >don't nee

Re: [PATCH 5/5] btrfs: extent_io: Unify the return value of btrfs_clone_extent_buffer() with alloc_extent_buffer()

2019-02-22 Thread Qu Wenruo
On 2019/2/22 下午8:47, Nikolay Borisov wrote: > > > On 22.02.19 г. 12:16 ч., Qu Wenruo wrote: >> The direct callers are: >> 1) qgroup_rescan_leaf() >> 2) btrfs_compare_trees() >>These two call sites are stubs. >> >> 3) tree_mod_log_rewind() >> 4) get_old_root() >>These two doesn't follow

Re: [PATCH 0/5] Unify the return value of alloc/clone_extent_buffer()

2019-02-22 Thread Nikolay Borisov
On 22.02.19 г. 12:16 ч., Qu Wenruo wrote: > This patchset can be fetched from github: > https://github.com/adam900710/linux/tree/cleanup_alloc_extent_buffer > Which is based on v5.0-rc7 > > There are 5 extent buffer alloc functions in btrfs: > __alloc_extent_buffer(); > alloc_extent_buffer(); >

[PATCH v1.1 5/5] btrfs: extent_io: Unify the return value of btrfs_clone_extent_buffer() with alloc_extent_buffer()

2019-02-22 Thread Qu Wenruo
The direct callers are: 1) qgroup_rescan_leaf() 2) btrfs_compare_trees() These two call sites are stubs. 3) tree_mod_log_rewind() 4) get_old_root() These two doesn't follow the name pattern *_extent_buffer(), thus we don't need to unify their return value. However for get_old_root(), a

Re: [PATCH 0/5] Unify the return value of alloc/clone_extent_buffer()

2019-02-22 Thread Qu Wenruo
On 2019/2/22 下午8:54, Nikolay Borisov wrote: > > > On 22.02.19 г. 12:16 ч., Qu Wenruo wrote: >> This patchset can be fetched from github: >> https://github.com/adam900710/linux/tree/cleanup_alloc_extent_buffer >> Which is based on v5.0-rc7 >> >> There are 5 extent buffer alloc functions in btrfs

Re: [PATCH 0/5] Unify the return value of alloc/clone_extent_buffer()

2019-02-22 Thread Nikolay Borisov
On 22.02.19 г. 15:02 ч., Qu Wenruo wrote: > > > On 2019/2/22 下午8:54, Nikolay Borisov wrote: >> >> >> On 22.02.19 г. 12:16 ч., Qu Wenruo wrote: >>> This patchset can be fetched from github: >>> https://github.com/adam900710/linux/tree/cleanup_alloc_extent_buffer >>> Which is based on v5.0-rc7 >

Re: [PATCH 0/5] Unify the return value of alloc/clone_extent_buffer()

2019-02-22 Thread Qu Wenruo
On 2019/2/22 下午9:29, Nikolay Borisov wrote: > > > On 22.02.19 г. 15:02 ч., Qu Wenruo wrote: >> >> >> On 2019/2/22 下午8:54, Nikolay Borisov wrote: >>> >>> >>> On 22.02.19 г. 12:16 ч., Qu Wenruo wrote: This patchset can be fetched from github: https://github.com/adam900710/linux/tree/cle

Re: [PATCH 0/5] Unify the return value of alloc/clone_extent_buffer()

2019-02-22 Thread Qu Wenruo
On 2019/2/22 下午9:29, Nikolay Borisov wrote: > > > On 22.02.19 г. 15:02 ч., Qu Wenruo wrote: >> >> >> On 2019/2/22 下午8:54, Nikolay Borisov wrote: >>> >>> >>> On 22.02.19 г. 12:16 ч., Qu Wenruo wrote: This patchset can be fetched from github: https://github.com/adam900710/linux/tree/cle

Re: [LSF/MM TOPIC] More async operations for file systems - async discard?

2019-02-22 Thread Martin K. Petersen
Roman, >> Consequently, many of the modern devices that claim to support >> discard to make us software folks happy (or to satisfy a purchase >> order requirements) complete the commands without doing anything at >> all. We're simply wasting queue slots. > > Any example of such devices? Let alo

Re: [PATCH] Btrfs: remove assertion when searching for a key in a node/leaf

2019-02-22 Thread David Sterba
On Wed, Feb 20, 2019 at 11:11:43AM +, fdman...@kernel.org wrote: > From: Filipe Manana > > At ctree.c:key_search(), the assertion that verifies the first key on a > child extent buffer corresponds to the key at a specific slot in the > parent has a disadvantage: we effectively hit a BUG_ON()

Re: [PATCH v2 -next] btrfs: Remove unnecessary casts in btrfs_read_root_item

2019-02-22 Thread David Sterba
On Wed, Feb 20, 2019 at 12:32:02PM +, YueHaibing wrote: > There is a messy cast here: > min_t(int, len, (int)sizeof(*item))); > > min_t() should normally cast to unsigned. It's not possible for > "len" to be negative, but if it were then we definitely > wouldn't want to pass negatives t

Re: [PATCH v3] btrfs: factor our read/write stage off csum_tree_block() into its callers

2019-02-22 Thread David Sterba
On Tue, Feb 19, 2019 at 01:43:53PM +0100, Johannes Thumshirn wrote: > Currently csum_tree_block() does two things, first it as it's name > suggests it calculates the checksum for a tree-block. But it also writes > this checksum to disk or reads an extent_buffer from disk and compares the > checksum

Re: [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-22 Thread David Sterba
On Thu, Feb 14, 2019 at 02:00:07AM -0800, Omar Sandoval wrote: > From: Omar Sandoval > Since statx was added in 4.11, userspace has had an interface for > reading btime (file creation time), but no way to set it. This RFC patch > series adds support for changing btime with utimensat(). Patch 1 add

Re: [PATCH v5.1 00/12] btrfs: Enhancement to tree block validation

2019-02-22 Thread David Sterba
On Mon, Feb 18, 2019 at 01:27:41PM +0800, Qu Wenruo wrote: > v5.1: > - Add "block=%llu " output for write/read time error line. > - Also output read time error message for fsid/start/level check. I see reports from tests btrfs/124 and btrfs/125, the tested branch was for-next-20190220. Something's

Re: [PATCH v5.1 00/12] btrfs: Enhancement to tree block validation

2019-02-22 Thread David Sterba
On Thu, Feb 21, 2019 at 08:37:40AM +0800, Qu Wenruo wrote: > > > On 2019/2/21 上午2:25, David Sterba wrote: > > On Mon, Feb 18, 2019 at 01:27:41PM +0800, Qu Wenruo wrote: > >> Patchset can be fetched from github: > >> https://github.com/adam900710/linux/tree/write_time_tree_checker > >> Which is ba

Re: [PATCH] fs/btrfs: init csum_list before possible free

2019-02-22 Thread David Sterba
On Thu, Feb 21, 2019 at 02:57:27PM +, Dan Robertson wrote: > > Thanks, it's been there since the first merge of scrub, but hard to hit. > > Yeah, very hard to hit. Debated submitting a patch, but the fix seemed > simple enough, so figured I'd send one in. > > Side note: I noticed most of the

Re: [LSF/MM TOPIC] More async operations for file systems - async discard?

2019-02-22 Thread Keith Busch
On Thu, Feb 21, 2019 at 09:51:12PM -0500, Martin K. Petersen wrote: > > Keith, > > > With respect to fs block sizes, one thing making discards suck is that > > many high capacity SSDs' physical page sizes are larger than the fs > > block size, and a sub-page discard is worse than doing nothing. >

Re: [PATCH] btrfs: zstd ensure reclaim timer is properly cleaned up

2019-02-22 Thread Dennis Zhou
On Fri, Feb 22, 2019 at 02:17:41PM +0200, Nikolay Borisov wrote: > > > On 21.02.19 г. 22:25 ч., Dennis Zhou wrote: > > The timer function, zstd_reclaim_timer_fn(), reschedules itself under > > certain conditions. Switch to del_timer_sync() to ensure that the timer > > function hasn't rescheduled

Re: [PATCH] fs/btrfs: init csum_list before possible free

2019-02-22 Thread Dan Robertson
Got it. Thanks for the clarification. signature.asc Description: Digital signature

Re: [PATCH 3/4] Btrfs: check if destination root is read-only for deduplication

2019-02-22 Thread David Sterba
On Fri, Feb 22, 2019 at 11:13:48AM +, Filipe Manana wrote: > So not doing nothing for now, that is, not applying this patch to > disable dedupe on RO roots and wait for a better solution (best case, > for 5.2 merge window), is reasonable > and not something I'm against. > David, would you consi

[PATCH v4 06/10] btrfs: start transaction in btrfs_set_prop_trans

2019-02-22 Thread Anand Jain
In preparation to make trans argument of btrfs_setxattr() a mandatory, start the transaction in btrfs_set_prop_trans. Signed-off-by: Anand Jain --- v4: born fs/btrfs/props.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/props.c b/fs/btrfs/prop

[PATCH v4 08/10] btrfs: start transaction in btrfs_xattr_handler_set

2019-02-22 Thread Anand Jain
Generic extended attributes on the inode are set using btrfs_xattr_handler_set(), and the required transaction for this update is started by btrfs_setxattr(). For better granulation of the transaction start and end, do this in btrfs_xattr_handler_set(). Suggested-by: David Sterba Signed-off-by: A

[PATCH v4 04/10] btrfs: rename fs_info argument to fs_private

2019-02-22 Thread Anand Jain
fs_info is commonly used to represent struct fs_info *, rename to fs_private to avoid confusion. Signed-off-by: Anand Jain --- v4: born fs/btrfs/xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 499bb79ba135..6971cbf286b5 10

[PATCH v4 10/10] btrfs: kill btrfs_setxattr

2019-02-22 Thread Anand Jain
Now btrfs_setxattr() is a very small function with just check for readonly FS and redirect the call to do_setxattr(). So instead move that checks to the parent functions. Signed-off-by: Anand Jain --- v4: born fs/btrfs/acl.c | 9 - fs/btrfs/props.c | 16 ++-- fs/btrfs/xatt

[PATCH v4 05/10] btrfs: refactor btrfs_set_prop add btrfs_set_prop_trans

2019-02-22 Thread Anand Jain
btrfs_set_prop() accepts transaction pointer as the first argument, however in ioctl.c for the purpose of setting the compression property, we call btrfs_set_prop() with NULL transaction pointer. Down in the call chain btrfs_setxattr() would start transaction to update the attribute and also to up

[PATCH v4 01/10] btrfs: kill __btrfs_set_prop()

2019-02-22 Thread Anand Jain
btrfs_set_prop() is a redirect to __btrfs_set_prop() with the transaction handler equal to NULL. And __btrfs_set_prop() inturn diectly uses trans to do_setxattr() which when trans is NULL creates a transaction. Instead rename __btrfs_set_prop() to btrfs_set_prop(), and update the caller with NULL

[PATCH v4 00/10] Misc props.c cleanups

2019-02-22 Thread Anand Jain
v4: More cleanups patch 4-10 were added. 4/10 is a generic cleanup. 5-9/10 are cleanups to assist killing btrfs_setxattr(). And 10/10 kills btrfs_setxattr(). v3: Merge patch 2/5 and 3/5 as in v1. Not included 1/5 in v1 as its already integrated in misc-next. While adding the readmirro

[PATCH v4 02/10] btrfs: drop redundant forward declaration in props.c

2019-02-22 Thread Anand Jain
Drop forward declaration of the functions, prop_compression_validate(), prop_compression_apply() and prop_compression_extract(). By moving prop_handlers[], btrfs_props_init() prop_compression_validate(), prop_compression_apply() and prop_compression_extract() appropriately within the file. No funct

[PATCH v4 03/10] btrfs: trivial, fix c coding style

2019-02-22 Thread Anand Jain
Maintain the lines extented upto 80 char where possible, and indent the argument. Signed-off-by: Anand Jain Reviewed-by: Nikolay Borisov --- v4: none. v3: changelog added. fs/btrfs/props.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fs/btrfs/props.c b/f

[PATCH v4 09/10] btrfs: btrfs_setxattr argument trans is never NULL

2019-02-22 Thread Anand Jain
The following patches btrfs: cleanup btrfs_set_acl btrfs: start transaction in btrfs_xattr_handler_set btrfs: create transaction in btrfs_set_prop_notrans made the btrfs_setxattr() argument trans to be never NULL, so delete the code when trans is NULL in btrfs_setxattr(). Also fix the c-c

[PATCH v4 07/10] btrfs: start transaction in btrfs_set_acl

2019-02-22 Thread Anand Jain
The main motivation is to avoid NULL for the trans argument reaching btrfs_set_xattr(). This patch does the following in btrfs_set_acl(). Create transaction and handle the inode changes update. Rename __btrfs_set_acl to do_set_acl as this is a helper function. Fix a c-code style, expand funct

[PATCH RESEND 1/2] btrfs-progs: check for no result before using results

2019-02-22 Thread Anand Jain
User space understands the ioctl BTRFS_IOC_DEV_REPLACE command status using the struct btrfs_ioctl_dev_replace_args::result, and so userspace initializes this to BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_RESULT, so exclude this value in checking for the error. Signed-off-by: Anand Jain --- cmds-replace.

[PATCH RESEND 2/2] btrfs-progs: replace: gracefully handle the exclusive operation report

2019-02-22 Thread Anand Jain
Replace start fails to report the appropriate error if balance is already running, as below, btrfs rep start -B -f /dev/sdb /dev/sde /btrfs ERROR: ioctl(DEV_REPLACE_START) on '/btrfs' returns error: Fix it by checking if the return is > 0, as the kernel returns BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRE

Re: [PATCH v3 1/6] btrfs: Refactor cow_file_range_async

2019-02-22 Thread David Sterba
On Thu, Feb 21, 2019 at 05:09:01PM +0200, Nikolay Borisov wrote: > On 21.02.19 г. 17:07 ч., Johannes Thumshirn wrote: > > On 21/02/2019 14:25, Nikolay Borisov wrote: > >> On 21.02.19 г. 15:15 ч., Johannes Thumshirn wrote: > >>> On 21/02/2019 12:57, Nikolay Borisov wrote: > > static int

Re: [PATCH v3 1/6] btrfs: Refactor cow_file_range_async

2019-02-22 Thread David Sterba
On Thu, Feb 21, 2019 at 01:57:12PM +0200, Nikolay Borisov wrote: > This commit changes the implementation of cow_file_range_async in order > to get rid of the BUG_ON in the middle of the loop. Additionally it > reworks the inner loop in the hopes of making it more understandable. > > The idea is t

Re: [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-22 Thread Omar Sandoval
On Tue, Feb 19, 2019 at 09:18:20AM +1100, Dave Chinner wrote: > On Sat, Feb 16, 2019 at 06:57:45PM -0700, Andreas Dilger wrote: > > While it may be a bit of a stretch to call this "forensic evidence", making > > We do forensic analysis of corrupt filesystems looking for evidence > of what went wro

[PATCH v2] btrfs: zstd ensure reclaim timer is properly cleaned up

2019-02-22 Thread Dennis Zhou
The timer function, zstd_reclaim_timer_fn(), reschedules itself under certain conditions. When cleaning up, take the lock and remove all workspaces. This prevents the timer from rearming itself. Lastly, switch to del_timer_sync() to ensure that the timer function can't trigger as we're unloading.

Re: [PATCH v5.1 00/12] btrfs: Enhancement to tree block validation

2019-02-22 Thread Qu Wenruo
On 2019/2/22 下午11:18, David Sterba wrote: > On Mon, Feb 18, 2019 at 01:27:41PM +0800, Qu Wenruo wrote: >> v5.1: >> - Add "block=%llu " output for write/read time error line. >> - Also output read time error message for fsid/start/level check. > > I see reports from tests btrfs/124 and btrfs/125,

[PATCH v5.2 03/12] btrfs: disk-io: Show the timing of corrupted tree block explicitly

2019-02-22 Thread Qu Wenruo
Just add one extra line to show when the corruption is detected. Currently only read time detection is possible. The planned distinguish line would be: read time: block=X read time tree block corruption detected write time: block=X write time tree block corruption de