[PATCH 2/2] btrfs: submit a normal bio for the mirror dio read

2017-11-28 Thread Anand Jain
Similarly do not set the REQ_FAILFAST_DEV for mirror read bio during dio. [Taken from patch in ml btrfs: submit a normal bio for the mirror read] [When the fist mirror failed to read we submit bio again to read from the 2nd mirror, however during this, we also set the flag REQ_FAILFAST_DEV which

[PATCH 1/2] btrfs: submit a normal bio for the mirror read

2017-11-28 Thread Anand Jain
When the fist mirror failed to read we submit bio again to read from the 2nd mirror, however during this, we also set the flag REQ_FAILFAST_DEV which indicates to the underlying block device driver not to perform the default IO retry (sd, 5 counts), and thus command will be failed and returned at

[PATCH] fstests: btrfs: Add test case to check if btrfs can handle full fs trim correctly

2017-11-28 Thread Qu Wenruo
Ancient commit f4c697e6406d ("btrfs: return EINVAL if start > total_bytes in fitrim ioctl") introduced a regression where btrfs may fail to trim any free space in existing block groups. It's caused by confusion with btrfs_super_block->total_bytes and btrfs logical address space. Unlike physical

[PATCH 0/4] define BTRFS_DEV_STATE

2017-11-28 Thread Anand Jain
As of now device properties and states are being represented as int variable. Patches in the ML such as device failed state needs this cleanup as well. Anand Jain (4): btrfs: cleanup device states define BTRFS_DEV_STATE_WRITEABLE btrfs: cleanup device states define

[PATCH 2/4] btrfs: cleanup device states define BTRFS_DEV_STATE_IN_FS_METADATA

2017-11-28 Thread Anand Jain
Currently device state is being managed by each individual int variable such as struct btrfs_device::in_fs_metadata. Instead of that declare device state BTRFS_DEV_STATE_IN_FS_METADATA and use the bit operations. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 21

[PATCH 4/4] btrfs: cleanup device states define BTRFS_DEV_STATE_CAN_DISCARD

2017-11-28 Thread Anand Jain
Currently device state is being managed by each individual int variable such as struct btrfs_device::can_discard. Instead of that declare btrfs_device::dev_state BTRFS_DEV_STATE_CAN_DISCARD and use the bit operations. Signed-off-by: Anand Jain --- fs/btrfs/extent-tree.c |

[PATCH 3/4] btrfs: cleanup device states define BTRFS_DEV_STATE_MISSING

2017-11-28 Thread Anand Jain
Currently device state is being managed by each individual int variable such as struct btrfs_device::missing. Instead of that declare btrfs_device::dev_state BTRFS_DEV_STATE_MISSING and use the bit operations. Signed-off-by: Anand Jain --- fs/btrfs/dev-replace.c | 3 ++-

[PATCH 1/4] btrfs: cleanup device states define BTRFS_DEV_STATE_WRITEABLE

2017-11-28 Thread Anand Jain
Currently device state is being managed by each individual int variable such as struct btrfs_device::writeable. Instead of that declare device state BTRFS_DEV_STATE_WRITEABLE and use the bit operations. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 12 ++

Re: [PATCH 0/7] retry write on error

2017-11-28 Thread Anand Jain
On 11/29/2017 07:41 AM, p...@btrfs.list.sabi.co.uk wrote: If the underlying protocal doesn't support retry and there are some transient errors happening somewhere in our IO stack, we'd like to give an extra chance for IO. A limited number of retries may make sense, though I saw some long

[PATCH v3 2/3] btrfs-progs: fi defrag: do not exit if defrag range ioctl is unsupported

2017-11-28 Thread Su Yue
If ioctl of defrag range is unsupported, defrag will exit immediately. Since caller can handle the error, let cmd_filesystem_defrag() close file, break the loop and return error instead of calling exit(1). Suggested-by: David Sterba Signed-off-by: Su Yue

Re: [PATCH v2 3/3] btrfs-progs: fi defrag: extend -c to drop nocompress flag on files

2017-11-28 Thread Su Yue
On 11/29/2017 12:07 AM, David Sterba wrote: On Tue, Nov 28, 2017 at 05:14:50PM +0800, Su Yue wrote: Now, files which have nocompress flag also will be defraged with compression. However, nocompress flag is still existed and have to be cleared manually. So add an option '--clear-nocompress'

Re: Read before you deploy btrfs + zstd

2017-11-28 Thread Nick Terrell
> On Nov 28, 2017, at 3:49 PM, David Sterba wrote: > > On Tue, Nov 28, 2017 at 09:31:57PM +, Nick Terrell wrote: >> >>> On Nov 21, 2017, at 8:22 AM, David Sterba wrote: >>> >>> On Wed, Nov 15, 2017 at 08:09:15PM +, Nick Terrell wrote: On

Re: [PATCH 3/7] Btrfs: retry write for non-raid56

2017-11-28 Thread Liu Bo
On Wed, Nov 22, 2017 at 04:41:10PM +0200, Nikolay Borisov wrote: > > > On 22.11.2017 02:35, Liu Bo wrote: > > If the underlying protocal doesn't support retry and there are some > > transient errors happening somewhere in our IO stack, we'd like to > > give an extra chance for IO. > > > > In

Re: [PATCH] btrfs: handle dynamically reappearing missing device

2017-11-28 Thread Liu Bo
On Fri, Nov 17, 2017 at 07:53:29PM +0800, Anand Jain wrote: > > > On 11/17/2017 07:28 AM, Liu Bo wrote: > > On Sun, Nov 12, 2017 at 06:56:50PM +0800, Anand Jain wrote: > > > If the device is not present at the time of (-o degrade) mount > > > the mount context will create a dummy missing struct

Re: Read before you deploy btrfs + zstd

2017-11-28 Thread David Sterba
On Tue, Nov 28, 2017 at 09:31:57PM +, Nick Terrell wrote: > > > On Nov 21, 2017, at 8:22 AM, David Sterba wrote: > > > > On Wed, Nov 15, 2017 at 08:09:15PM +, Nick Terrell wrote: > >> On 11/15/17, 6:41 AM, "David Sterba" wrote: > >>> The branch is now

Re: [PATCH 0/7] retry write on error

2017-11-28 Thread Peter Grandi
>>> If the underlying protocal doesn't support retry and there >>> are some transient errors happening somewhere in our IO >>> stack, we'd like to give an extra chance for IO. >> A limited number of retries may make sense, though I saw some >> long stalls after retries on bad disks. Indeed! One

Re: [PATCH 0/7] retry write on error

2017-11-28 Thread Edmund Nadolski
On 11/28/2017 12:22 PM, David Sterba wrote: > On Tue, Nov 21, 2017 at 05:35:51PM -0700, Liu Bo wrote: >> If the underlying protocal doesn't support retry and there are some >> transient errors happening somewhere in our IO stack, we'd like to >> give an extra chance for IO. Or sometimes you see

Re: How about adding an ioctl to convert a directory to a subvolume?

2017-11-28 Thread Timofey Titovets
2017-11-28 21:48 GMT+03:00 David Sterba : > On Mon, Nov 27, 2017 at 05:41:56PM +0800, Lu Fengqi wrote: >> As we all know, under certain circumstances, it is more appropriate to >> create some subvolumes rather than keep everything in the same >> subvolume. As the condition of

Re: [PATCH v7 1/5] add infrastructure for tagging functions as error injectable

2017-11-28 Thread Josef Bacik
On Tue, Nov 28, 2017 at 11:58:41AM -0700, Jonathan Corbet wrote: > On Wed, 22 Nov 2017 16:23:30 -0500 > Josef Bacik wrote: > > > From: Josef Bacik > > > > Using BPF we can override kprob'ed functions and return arbitrary > > values. Obviously this can be a

Re: How about adding an ioctl to convert a directory to a subvolume?

2017-11-28 Thread Austin S. Hemmelgarn
On 2017-11-28 13:48, David Sterba wrote: On Mon, Nov 27, 2017 at 05:41:56PM +0800, Lu Fengqi wrote: As we all know, under certain circumstances, it is more appropriate to create some subvolumes rather than keep everything in the same subvolume. As the condition of demand change, the user may

Re: About 'key type for persistent [...] items'

2017-11-28 Thread David Sterba
On Tue, Nov 28, 2017 at 08:28:58PM +0100, Hans van Kranenburg wrote: > >> E.g. if I wanted to (just a random idea) add per device statistics, and > >> use this, I'd need to use the key also with objectid 1, 2, 3, etc... if > >> I have multiple devices. That's already a no go if there's anyone in

Re: About 'key type for persistent [...] items'

2017-11-28 Thread Hans van Kranenburg
Ok, just want to add one more thing :) On 11/28/2017 08:12 PM, David Sterba wrote: > On Tue, Nov 28, 2017 at 07:00:28PM +0100, Hans van Kranenburg wrote: >> On 11/28/2017 06:34 PM, David Sterba wrote: >>> On Fri, Nov 24, 2017 at 08:16:05PM +0100, Hans van Kranenburg wrote: Last week, when

Re: [PATCH 0/7] retry write on error

2017-11-28 Thread David Sterba
On Tue, Nov 21, 2017 at 05:35:51PM -0700, Liu Bo wrote: > If the underlying protocal doesn't support retry and there are some > transient errors happening somewhere in our IO stack, we'd like to > give an extra chance for IO. Or sometimes you see btrfs reporting > 'wrr 1 flush 0 read 0 blabla'

Re: About 'key type for persistent [...] items'

2017-11-28 Thread David Sterba
On Tue, Nov 28, 2017 at 07:00:28PM +0100, Hans van Kranenburg wrote: > On 11/28/2017 06:34 PM, David Sterba wrote: > > On Fri, Nov 24, 2017 at 08:16:05PM +0100, Hans van Kranenburg wrote: > >> Last week, when implementing the automatic classifier to dynamically > >> create tree item data objects

Re: [PATCH 1/5] btrfs-progs: Add location check when process share_data_ref item

2017-11-28 Thread David Sterba
On Fri, Nov 24, 2017 at 06:41:28PM +0800, Gu Jinxiang wrote: > The following test failed becasuse share_data_ref be added into > extent_cache when deal with root tree node. The whole function run_next_block would need to be revisited with respect to error handling and sanity checks. Adding them

Re: [PATCH v7 1/5] add infrastructure for tagging functions as error injectable

2017-11-28 Thread Jonathan Corbet
On Wed, 22 Nov 2017 16:23:30 -0500 Josef Bacik wrote: > From: Josef Bacik > > Using BPF we can override kprob'ed functions and return arbitrary > values. Obviously this can be a bit unsafe, so make this feature opt-in > for functions. Simply tag a

Re: How about adding an ioctl to convert a directory to a subvolume?

2017-11-28 Thread David Sterba
On Mon, Nov 27, 2017 at 05:41:56PM +0800, Lu Fengqi wrote: > As we all know, under certain circumstances, it is more appropriate to > create some subvolumes rather than keep everything in the same > subvolume. As the condition of demand change, the user may need to > convert a previous directory

Re: About 'key type for persistent [...] items'

2017-11-28 Thread Hans van Kranenburg
On 11/28/2017 06:34 PM, David Sterba wrote: > On Fri, Nov 24, 2017 at 08:16:05PM +0100, Hans van Kranenburg wrote: >> Last week, when implementing the automatic classifier to dynamically >> create tree item data objects by key type in python-btrfs, I ran into >> the following commits in

Re: About 'key type for persistent [...] items'

2017-11-28 Thread David Sterba
On Sat, Nov 25, 2017 at 09:12:35AM +0800, Qu Wenruo wrote: > On 2017年11月25日 03:16, Hans van Kranenburg wrote: > > Last week, when implementing the automatic classifier to dynamically > > create tree item data objects by key type in python-btrfs, I ran into > > the following commits in btrfs-progs:

Re: About 'key type for persistent [...] items'

2017-11-28 Thread David Sterba
On Fri, Nov 24, 2017 at 08:16:05PM +0100, Hans van Kranenburg wrote: > Last week, when implementing the automatic classifier to dynamically > create tree item data objects by key type in python-btrfs, I ran into > the following commits in btrfs-progs: > > commit

Re: [PATCH v7 0/4] Add the ability to do BPF directed error injection

2017-11-28 Thread Daniel Borkmann
On 11/22/2017 10:23 PM, Josef Bacik wrote: > This is hopefully the final version, I've addressed the comment by Igno and > added his Acks. > > v6->v7: > - moved the opt-in macro to bpf.h out of kprobes.h. > > v5->v6: > - add BPF_ALLOW_ERROR_INJECTION() tagging for functions that will support

Re: [PATCH] Btrfs: incremental send, fix wrong unlink path after renaming file

2017-11-28 Thread David Sterba
On Fri, Nov 17, 2017 at 02:48:30PM +, fdman...@kernel.org wrote: > From: Filipe Manana > > Under some circumstances, an incremental send operation can issue wrong > paths for unlink commands related to files that have multiple hard links > and some (or all) of those links

Re: [PATCH] btrfs-progs: mkfs: fix verbose value

2017-11-28 Thread David Sterba
On Fri, Nov 24, 2017 at 02:24:17PM +0900, Misono, Tomohiro wrote: > The value of 'verbose' is either 1 (default) or 0 (-q) > and "verbose >= 2" will not be true. > > After fix this, we get something like: > adding device /dev/sde id 2 > adding device /dev/sdf id 3 > during mkfs time when

Re: [PATCH v2 1/3] btrfs-progs: fi defrag: clean up duplicate code if find errors

2017-11-28 Thread David Sterba
On Tue, Nov 28, 2017 at 05:14:48PM +0800, Su Yue wrote: > In function cmd_filesystem_defrag(), lines of code for error handling > are duplicate and hard to expand in further. > > Create a jump label for errors. > > Signed-off-by: Su Yue Applied, thanks. -- To

Re: [PATCH v2 3/3] btrfs-progs: fi defrag: extend -c to drop nocompress flag on files

2017-11-28 Thread David Sterba
On Tue, Nov 28, 2017 at 05:14:50PM +0800, Su Yue wrote: > Now, files which have nocompress flag also will be defraged > with compression. However, nocompress flag is still existed > and have to be cleared manually. > > So add an option '--clear-nocompress' to extend -c to drop > nocompress flag

Re: [PATCH v2 2/3] btrfs-progs: fi defrag: do not exit if defrag range ioctl is unsupported

2017-11-28 Thread David Sterba
On Tue, Nov 28, 2017 at 05:14:49PM +0800, Su Yue wrote: > If ioctl of defrag range is unsupported, defrag will exit > immediately. > > Since caller can handle the error, let cmd_filesystem_defrag() > break the loop and return error instead of calling exit(1). > > Suggested-by: David Sterba

Re: [PATCH 0/7] btrfs-progs: mkfs: Reword --rootdir

2017-11-28 Thread David Sterba
On Fri, Oct 20, 2017 at 09:59:00AM +0800, Qu Wenruo wrote: > Qu Wenruo (7): > btrfs-progs: mkfs: Don't use custom chunk allocator for rootdir > btrfs-progs: mkfs/rootdir: Use over-reserve method to make size > estimate easier > btrfs-progs: mkfs: Only zero out the first 1M for rootdir >

Re: [PATCH 6/7] btrfs-progs: mkfs: Update allocation info before verbose output

2017-11-28 Thread David Sterba
On Fri, Oct 20, 2017 at 09:59:06AM +0800, Qu Wenruo wrote: > Since new --rootdir can allocate chunk, it will modify the chunk > allocation result. > > This patch will update allocation info before verbose output to reflect > such info. > > Signed-off-by: Qu Wenruo Applied,

Re: [PATCH 4/7] btrfs-progs: mkfs/rootdir: Introduce function to get end position of last device extent

2017-11-28 Thread David Sterba
On Fri, Oct 20, 2017 at 09:59:04AM +0800, Qu Wenruo wrote: > Useful for later 'mkfs.btrfs --rootdir' shrink support. > > Signed-off-by: Qu Wenruo Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to

Re: [PATCH 3/7] btrfs-progs: mkfs: Only zero out the first 1M for rootdir

2017-11-28 Thread David Sterba
On Fri, Oct 20, 2017 at 09:59:03AM +0800, Qu Wenruo wrote: > It's a waste of IO to fill the whole image before creating btrfs on it, > just wiping the first 1M, and then write 1 byte to the last position to > create a sparse file. > > Signed-off-by: Qu Wenruo Applied, thanks. --

Re: [PATCH v4 4/4] btrfs-progs: test/mkfs: Test if the minimal device size is valid

2017-11-28 Thread David Sterba
On Wed, Nov 01, 2017 at 09:30:43AM +0800, Qu Wenruo wrote: > New test case to test if the minimal device size given by "mkfs.btrfs" > failure case is valid. > > Signed-off-by: Qu Wenruo Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in

Re: splat on 4.15-rc1: invalid ram_bytes for uncompressed inline extent

2017-11-28 Thread David Sterba
On Tue, Nov 28, 2017 at 02:16:15AM +0100, Adam Borowski wrote: > On Tue, Nov 28, 2017 at 08:51:07AM +0800, Qu Wenruo wrote: > > On 2017年11月27日 22:22, David Sterba wrote: > > > On Mon, Nov 27, 2017 at 02:23:49PM +0100, Adam Borowski wrote: > > >> On 4.15-rc1, I get the following failure: > > >> > >

Re: swapon: swapfile has holes

2017-11-28 Thread Austin S. Hemmelgarn
On 2017-11-28 07:31, Cristian wrote: Hello, Report in: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1723449 dmesg: [ 3.782191] swapon: swapfile has holes As mentioned in the linked bug report, this is a known issue. To use a swap file on BTRFS, you need to: 1. Create an empty

Re: [PATCH v4 1/4] btrfs-progs: mkfs: Enhance minimal device size calculation to fix mkfs failure on small file

2017-11-28 Thread David Sterba
On Tue, Nov 28, 2017 at 08:40:47AM +0800, Qu Wenruo wrote: > > > On 2017年11月28日 07:21, David Sterba wrote: > > On Wed, Nov 01, 2017 at 09:30:40AM +0800, Qu Wenruo wrote: > >> +u64 btrfs_min_dev_size(u32 nodesize, int mixed, u64 meta_profile, > >> + u64 data_profile) > >> +{ > >>

swapon: swapfile has holes

2017-11-28 Thread Cristian
Hello, Report in: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1723449 dmesg: [ 3.782191] swapon: swapfile has holes Regards, -- Cristian -- 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

[PATCH v2 3/3] btrfs-progs: fi defrag: extend -c to drop nocompress flag on files

2017-11-28 Thread Su Yue
Now, files which have nocompress flag also will be defraged with compression. However, nocompress flag is still existed and have to be cleared manually. So add an option '--clear-nocompress' to extend -c to drop nocompress flag after defragement. Suggested-by: David Sterba

[PATCH v2 2/3] btrfs-progs: fi defrag: do not exit if defrag range ioctl is unsupported

2017-11-28 Thread Su Yue
If ioctl of defrag range is unsupported, defrag will exit immediately. Since caller can handle the error, let cmd_filesystem_defrag() break the loop and return error instead of calling exit(1). Suggested-by: David Sterba Signed-off-by: Su Yue ---

[PATCH v2 1/3] btrfs-progs: fi defrag: clean up duplicate code if find errors

2017-11-28 Thread Su Yue
In function cmd_filesystem_defrag(), lines of code for error handling are duplicate and hard to expand in further. Create a jump label for errors. Signed-off-by: Su Yue --- Changelog: v2: Record -errno to return value if open() and fstat() failed. Move

Re: [PATCH 3/3] btrfs-progs: check: exclude extents of tree blocks and extent items

2017-11-28 Thread Su Yue
On 11/28/2017 04:25 PM, Qu Wenruo wrote: On 2017年11月28日 15:47, Su Yue wrote: On 11/28/2017 12:05 PM, Qu Wenruo wrote: On 2017年11月28日 10:38, Su Yue wrote: Thanks for review. On 11/27/2017 06:37 PM, Qu Wenruo wrote: On 2017年11月27日 11:13, Su Yue wrote: Commit d17d6663c99c

Re: How about adding an ioctl to convert a directory to a subvolume?

2017-11-28 Thread Qu Wenruo
On 2017年11月28日 16:29, Lu Fengqi wrote: > On Mon, Nov 27, 2017 at 06:13:10PM +0800, Qu Wenruo wrote: >> >> >> On 2017年11月27日 17:41, Lu Fengqi wrote: >>> Hi all, >>> >>> As we all know, under certain circumstances, it is more appropriate to >>> create some subvolumes rather than keep everything in

Re: How about adding an ioctl to convert a directory to a subvolume?

2017-11-28 Thread Lu Fengqi
On Mon, Nov 27, 2017 at 06:13:10PM +0800, Qu Wenruo wrote: > > >On 2017年11月27日 17:41, Lu Fengqi wrote: >> Hi all, >> >> As we all know, under certain circumstances, it is more appropriate to >> create some subvolumes rather than keep everything in the same >> subvolume. As the condition of demand

Re: [PATCH 3/3] btrfs-progs: check: exclude extents of tree blocks and extent items

2017-11-28 Thread Qu Wenruo
On 2017年11月28日 15:47, Su Yue wrote: > > > On 11/28/2017 12:05 PM, Qu Wenruo wrote: >> >> >> On 2017年11月28日 10:38, Su Yue wrote: >>> Thanks for review. >>> >>> On 11/27/2017 06:37 PM, Qu Wenruo wrote: On 2017年11月27日 11:13, Su Yue wrote: > Commit d17d6663c99c ("btrfs-progs: