Re: [PATCH] btrfs: qgroup: Fix inconsistent IS_ERR and PTR_ERR

2019-01-31 Thread Gustavo A. R. Silva
On 1/31/19 5:49 AM, David Sterba wrote: > On Wed, Jan 30, 2019 at 08:30:16PM -0600, Gustavo A. R. Silva wrote: >> Fix inconsistent IS_ERR and PTR_ERR in btrfs_qgroup_trace_subtree_after_cow >> >> The proper pointer to be passed as argument is reloc_eb. >> >> This bug was detected with the help o

Re: [PATCH 01/15] btrfs: Honour FITRIM range constraints during free space trim

2019-01-31 Thread Nikolay Borisov
On 31.01.19 г. 21:30 ч., Jeff Mahoney wrote: > On 1/31/19 10:35 AM, Nikolay Borisov wrote: >> >> >> On 31.01.19 г. 17:21 ч., David Sterba wrote: >>> On Wed, Jan 30, 2019 at 04:50:48PM +0200, Nikolay Borisov wrote: Up until know trimming the freespace was done irrespective of what the a

Re: [PATCH 01/15] btrfs: Honour FITRIM range constraints during free space trim

2019-01-31 Thread Jeff Mahoney
On 1/31/19 10:35 AM, Nikolay Borisov wrote: > > > On 31.01.19 г. 17:21 ч., David Sterba wrote: >> On Wed, Jan 30, 2019 at 04:50:48PM +0200, Nikolay Borisov wrote: >>> Up until know trimming the freespace was done irrespective of what the >>> arguments of the FITRIM ioctl were. For example fstrim'

mkfs.btrfs reports Device or resource busy for unmounted device

2019-01-31 Thread Karollil, Anoop (GE Digital)
Hello, I faced an issue with mkfs.btrfs reporting “Device or resource busy” for an unmounted device. Maybe the umount should have failed as a process listed the btrfs filesystem in its /proc/PID/mountinfo after the umount. A subsequent mkfs.btrfs did fail when it tried to open the device with

Re: [PATCH 11/11] btrfs: add zstd compression level support

2019-01-31 Thread David Sterba
On Mon, Jan 28, 2019 at 04:24:37PM -0500, Dennis Zhou wrote: > static struct list_head *zstd_get_workspace(unsigned int level) > { > - struct list_head *ws = btrfs_get_workspace(&wsm, level); > - struct workspace *workspace = list_entry(ws, struct workspace, list); > + struct list_hea

Re: [PATCH 11/11] btrfs: add zstd compression level support

2019-01-31 Thread David Sterba
On Mon, Jan 28, 2019 at 04:24:37PM -0500, Dennis Zhou wrote: > As mentioned above, a requirement that differs zstd from zlib is that > higher levels of compression require more memory. To manage this, each > compression level has its own queue of workspaces. A global LRU is used > to help with recl

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

2019-01-31 Thread Hugo Mills
On Thu, Jan 31, 2019 at 04:39:22PM +, Filipe Manana wrote: > On Thu, Dec 13, 2018 at 4:08 PM David Sterba wrote: > > > > On Wed, Dec 12, 2018 at 06:05:58PM +, fdman...@kernel.org wrote: > > > From: Filipe Manana > > > > > > Checking if the destination root is read-only was being performed

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

2019-01-31 Thread Filipe Manana
On Thu, Dec 13, 2018 at 4:08 PM David Sterba wrote: > > On Wed, Dec 12, 2018 at 06:05:58PM +, fdman...@kernel.org wrote: > > From: Filipe Manana > > > > Checking if the destination root is read-only was being performed only for > > clone operations. Make deduplication check it as well, as it

Re: [PATCH 4/4] Btrfs: remove no longer needed range length checks for deduplication

2019-01-31 Thread Filipe Manana
On Wed, Dec 12, 2018 at 6:07 PM wrote: > > From: Filipe Manana > > Comparing the content of the pages in the range to deduplicate is now done > by the generic helper generic_remap_file_range_prep(), which takes care of > ensuring we do not compare/deduplicate undefined data beyond a file's eof >

Re: [PATCH 01/11] btrfs: add macros for compression type and level

2019-01-31 Thread Dennis Zhou
On Thu, Jan 31, 2019 at 05:00:10PM +0100, David Sterba wrote: > On Mon, Jan 28, 2019 at 04:24:27PM -0500, Dennis Zhou wrote: > > It is very easy to miss places that rely on a certain bitshifting for > > decyphering the type_level overloading. Make macros handle this instead. > > This encoding was

Re: [PATCH 03/11] btrfs: manage heuristic workspace as index 0

2019-01-31 Thread David Sterba
On Mon, Jan 28, 2019 at 04:24:29PM -0500, Dennis Zhou wrote: > While the heuristic workspaces aren't really compression workspaces, > they use the same interface for managing them. So rather than branching, > let's just handle them once again as the index 0 compression type. > > Signed-off-by: Den

Re: [PATCH 01/11] btrfs: add macros for compression type and level

2019-01-31 Thread David Sterba
On Mon, Jan 28, 2019 at 04:24:27PM -0500, Dennis Zhou wrote: > It is very easy to miss places that rely on a certain bitshifting for > decyphering the type_level overloading. Make macros handle this instead. This encoding was a simple way to introduce the combined type and level for zlib and it co

Re: [PATCH 00/11] btrfs: add zstd compression level support

2019-01-31 Thread Dennis Zhou
On Thu, Jan 31, 2019 at 03:04:36PM +0100, David Sterba wrote: > On Wed, Jan 30, 2019 at 12:40:59PM -0500, Dennis Zhou wrote: > > Hi David, > > > > On Tue, Jan 29, 2019 at 06:18:30PM +0100, David Sterba wrote: > > > On Mon, Jan 28, 2019 at 04:24:26PM -0500, Dennis Zhou wrote: > > > > As mentioned a

Re: [PATCH 01/15] btrfs: Honour FITRIM range constraints during free space trim

2019-01-31 Thread David Sterba
On Thu, Jan 31, 2019 at 05:35:10PM +0200, Nikolay Borisov wrote: > On 31.01.19 г. 17:21 ч., David Sterba wrote: > > On Wed, Jan 30, 2019 at 04:50:48PM +0200, Nikolay Borisov wrote: > >> Up until know trimming the freespace was done irrespective of what the > >> arguments of the FITRIM ioctl were. F

[PATCH v3] btrfs: Switch btrfs_trim_free_extents to find_first_clear_extent_bit

2019-01-31 Thread Nikolay Borisov
Instead of always calling the allocator to search for a free extent, that satisfies the input criteria, switch btrfs_trim_free_extents to using find_first_clear_extent_bit. With this change it's no longer necessary to read the device tree in order to figure out holes in the devices. Now the code a

[PATCH v2] btrfs: Switch btrfs_trim_free_extents to find_first_clear_extent_bit

2019-01-31 Thread Nikolay Borisov
Instead of always calling the allocator to search for a free extent, that satisfies the input criteria, switch btrfs_trim_free_extents to using find_first_clear_extent_bit. With this change it's no longer necessary to read the device tree in order to figure out holes in the devices. Now the code a

Re: [PATCH 01/15] btrfs: Honour FITRIM range constraints during free space trim

2019-01-31 Thread Nikolay Borisov
On 31.01.19 г. 17:21 ч., David Sterba wrote: > On Wed, Jan 30, 2019 at 04:50:48PM +0200, Nikolay Borisov wrote: >> Up until know trimming the freespace was done irrespective of what the >> arguments of the FITRIM ioctl were. For example fstrim's -o/-l arguments >> will be entirely ignored. Fix i

Re: [PATCH 03/15] btrfs: Remove EXTENT_FIRST_DELALLOC bit

2019-01-31 Thread David Sterba
On Wed, Jan 30, 2019 at 04:50:50PM +0200, Nikolay Borisov wrote: > With the refactoring introduced in 8b62f87bad9c ("Btrfs: reworki > outstanding_extents") this flag became unused. Remove it and renumber > the following flags accordingly. No functional changes. > > Signed-off-by: Nikolay Borisov

Re: [PATCH 02/15] btrfs: Make WARN_ON in a canonical form

2019-01-31 Thread David Sterba
On Wed, Jan 30, 2019 at 04:50:49PM +0200, Nikolay Borisov wrote: > There is no point in using a construct like 'if (!condition) > WARN_ON(1)'. Use WARN_ON(!condition) directly. No functional changes. > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba

Re: [PATCH 01/15] btrfs: Honour FITRIM range constraints during free space trim

2019-01-31 Thread David Sterba
On Wed, Jan 30, 2019 at 04:50:48PM +0200, Nikolay Borisov wrote: > Up until know trimming the freespace was done irrespective of what the > arguments of the FITRIM ioctl were. For example fstrim's -o/-l arguments > will be entirely ignored. Fix it by correctly handling those paramter. > This requir

Re: File alteration events?

2019-01-31 Thread Nikolay Borisov
On 31.01.19 г. 14:38 ч., Ronald Schaten wrote: > Hello everybody... > > This is my first mail to this list, and -- as much as I'd like to be -- > I'm not a kernel developer. So please forgive me if this isn't the right > place for questions like this. I'm thankful for any pointer into the > rig

Re: [PATCH v4 04/12] btrfs: extent_io: Move the BUG_ON() in flush_write_bio() one level up

2019-01-31 Thread David Sterba
On Thu, Jan 31, 2019 at 08:45:42AM +0800, Qu Wenruo wrote: > > > On 2019/1/30 下午11:19, David Sterba wrote: > > On Fri, Jan 25, 2019 at 01:09:17PM +0800, Qu Wenruo wrote: > >> +static int __must_check flush_write_bio(struct extent_page_data *epd) > >> { > >> - if (epd->bio) { > >> - int

Re: [PATCH v4 03/12] btrfs: disk-io: Show the timing of corrupted tree block explicitly

2019-01-31 Thread David Sterba
On Thu, Jan 31, 2019 at 08:03:36AM +0800, Qu Wenruo wrote: > On 2019/1/30 下午10:59, Nikolay Borisov wrote: > > On 30.01.19 г. 16:57 ч., David Sterba wrote: > >> On Fri, Jan 25, 2019 at 01:09:16PM +0800, Qu Wenruo wrote: > >>> Just add one extra line to show when the corruption is detected. > >>> Cur

Re: [PATCH v4 03/12] btrfs: disk-io: Show the timing of corrupted tree block explicitly

2019-01-31 Thread Nikolay Borisov
On 31.01.19 г. 16:20 ч., David Sterba wrote: > On Thu, Jan 31, 2019 at 08:03:36AM +0800, Qu Wenruo wrote: >> On 2019/1/30 下午10:59, Nikolay Borisov wrote: >>> On 30.01.19 г. 16:57 ч., David Sterba wrote: On Fri, Jan 25, 2019 at 01:09:16PM +0800, Qu Wenruo wrote: > Just add one extra line

Re: File alteration events?

2019-01-31 Thread Austin S. Hemmelgarn
On 2019-01-31 07:38, Ronald Schaten wrote: Hello everybody... This is my first mail to this list, and -- as much as I'd like to be -- I'm not a kernel developer. So please forgive me if this isn't the right place for questions like this. I'm thankful for any pointer into the right direction. T

Re: [PATCH 00/11] btrfs: add zstd compression level support

2019-01-31 Thread David Sterba
On Wed, Jan 30, 2019 at 12:40:59PM -0500, Dennis Zhou wrote: > Hi David, > > On Tue, Jan 29, 2019 at 06:18:30PM +0100, David Sterba wrote: > > On Mon, Jan 28, 2019 at 04:24:26PM -0500, Dennis Zhou wrote: > > > As mentioned above, a requirement that differs zstd from zlib is that > > > higher level

Re: File alteration events?

2019-01-31 Thread Steven Davies
On 2019-01-31 12:38, Ronald Schaten wrote: Hello everybody... I'm looking for a solution to track file changes on a fairly large filesystem. Many thousands of directories, millions of files. The volume is shared to other computers, changes can come from different sources (NFS, Samba, local

File alteration events?

2019-01-31 Thread Ronald Schaten
Hello everybody... This is my first mail to this list, and -- as much as I'd like to be -- I'm not a kernel developer. So please forgive me if this isn't the right place for questions like this. I'm thankful for any pointer into the right direction. The question: I'm looking for a solution to t

Re: [PATCH] btrfs: qgroup: Fix inconsistent IS_ERR and PTR_ERR

2019-01-31 Thread David Sterba
On Wed, Jan 30, 2019 at 08:30:16PM -0600, Gustavo A. R. Silva wrote: > Fix inconsistent IS_ERR and PTR_ERR in btrfs_qgroup_trace_subtree_after_cow > > The proper pointer to be passed as argument is reloc_eb. > > This bug was detected with the help of Coccinelle. > > Fixes: 2b35a512e9cf ("btrfs:

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

2019-01-31 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-01-31 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 1/2] btrfs: Don't search devid for every verify_one_dev_extent() call

2019-01-31 Thread Anand Jain
On 1/30/19 3:39 PM, Qu Wenruo wrote: verify_one_dev_extent() will call btrfs_find_device() for each dev extent, this waste some CPU time just searching the devices list. Move the search one level up, into the btrfs_verify_dev_extents(), so for each device we only call btrfs_find_device()