Re: [PATCH v2 1/4] btrfs: Remove userspace transaction ioctls

2018-02-05 Thread Sage Weil
On Mon, 5 Feb 2018, David Sterba wrote: > On Mon, Feb 05, 2018 at 05:52:52PM +0900, Wang Shilong wrote: > >These ioctl are originally introduced by Sage Weil for Ceph use? > > Not sure whether it still useful, Cc Sage just in case. > > We have checked that the ioctl is not used in ceph, the

Re: [PATCH v2 1/4] btrfs: Remove userspace transaction ioctls

2018-02-05 Thread David Sterba
On Mon, Feb 05, 2018 at 05:52:52PM +0900, Wang Shilong wrote: >These ioctl are originally introduced by Sage Weil for Ceph use? > Not sure whether it still useful, Cc Sage just in case. We have checked that the ioctl is not used in ceph, the reasons why we think it's ok to remove the ioctl

Re: [PATCH] btrfs: Add enospc_debug printing in metadata_reserve_bytes

2018-02-05 Thread Nikolay Borisov
On 15.12.2017 12:05, Nikolay Borisov wrote: > Currently when enoscp_debug mount option is turned on we do not print > any debug info in case metadata reservation failures happen. Fix this > by adding the necessary hook in reserve_metadata_bytes. > > Signed-off-by: Nikolay Borisov

[PATCH] btrfs: alloc_chunk: fix DUP stripe size handling

2018-02-05 Thread Hans van Kranenburg
In case of using DUP, we search for enough unallocated disk space on a device to hold two stripes. The devices_info[ndevs-1].max_avail that holds the amount of unallocated space found is directly assigned to stripe_size, while it's actually twice the stripe size. Later on in the code, an

Re: [RFC PATCH v2 2/4] btrfs-progs: Add EXEC represent path of executable file

2018-02-05 Thread David Sterba
On Sat, Feb 03, 2018 at 09:07:47AM +, Gu, Jinxiang wrote: > > > > -Original Message- > > From: David Sterba [mailto:dste...@suse.cz] > > Sent: Saturday, February 03, 2018 2:08 AM > > To: Gu, Jinxiang/顾 金香 > > Cc: linux-btrfs@vger.kernel.org; dste...@suse.cz;

[PATCH v2 2/4] btrfs: Remove btrfs_file_private::trans

2018-02-05 Thread Nikolay Borisov
Now that the userspace transaction IOCTL have been removed, this member is no longer used so just remove it Signed-off-by: Nikolay Borisov --- V2: * This was 3/4 before, but now move it to 2/4 since it makes more sense * Reword the subject to be more concise

[PATCH v2 1/4] btrfs: Remove userspace transaction ioctls

2018-02-05 Thread Nikolay Borisov
Commit 3558d4f88ec8 ("btrfs: Deprecate userspace transaction ioctls") marked the beginning of the end of userspace transaction. This commit finishes the job! Signed-off-by: Nikolay Borisov --- V2: * Also remove the usage of btrfs_ioctl_trans_end from btrfs_release_file so

[PATCH v2 3/4] btrfs: Remove code referencing unused TRANS_USERSPACE

2018-02-05 Thread Nikolay Borisov
Now that the userspace transaction ioctls have been removed, TRANS_USERSPACE is no longer used hence we can remove it. Signed-off-by: Nikolay Borisov --- V2: * This was 2/4 but now is 3/4 * Also remove the declaration of btrfs_start_ioctl_transaction from transaction.h

[PATCH v2 4/4] btrfs: Remove btrfs_fs_info::open_ioctl_trans

2018-02-05 Thread Nikolay Borisov
Since userspace transaction have been removed we no longer have use for this field so delete it. Signed-off-by: Nikolay Borisov --- V2: * No changes fs/btrfs/ctree.h | 1 - fs/btrfs/extent-tree.c | 3 +-- fs/btrfs/transaction.c | 9 +++-- 3 files changed, 4

Re: [PATCH v2 1/4] btrfs: Remove userspace transaction ioctls

2018-02-05 Thread Wang Shilong
These ioctl are originally introduced by Sage Weil for Ceph use? Not sure whether it still useful, Cc Sage just in case. 在 2018年2月5日,下午5:41,Nikolay Borisov 写道: Commit 3558d4f88ec8 ("btrfs: Deprecate userspace transaction ioctls") marked the beginning of the end of

[PATCH RFC] Btrfs: expose bad chunks in sysfs

2018-02-05 Thread Liu Bo
Btrfs tries its best to tolerate write errors, but kind of silently (except some messages in kernel log). For raid1 and raid10, this is usually not a problem because there is a copy as backup, while for parity based raid setup, i.e. raid5 and raid6, the problem is that, if a write error occurs

Re: [PATCH v2] btrfs: handle failure of add_pending_csums

2018-02-05 Thread David Sterba
On Fri, Jan 26, 2018 at 09:28:58AM -0500, Josef Bacik wrote: > On Mon, Jan 08, 2018 at 10:59:43AM +0200, Nikolay Borisov wrote: > > add_pending_csums was added as part of the new data=ordered implementation > > in > > e6dcd2dc9c48 ("Btrfs: New data=ordered implementation"). Even back then it > >

How to efficiently remove a subvolume with children located further than BTRFS_INO_LOOKUP_PATH_MAX?

2018-02-05 Thread Nikita Gerasimov
Hi All, I have an issue with recursively subvolume deletion when child created further than PATH_MAX. As I understand current algorithm is: - Find child by BTRFS_IOC_TREE_SEARCH, which is work fine. - Get relative path to child by BTRFS_IOC_INO_LOOKUP. (that's a problem) - Open child fd and

Re: [PATCH RFC] Btrfs: expose bad chunks in sysfs

2018-02-05 Thread Qu Wenruo
On 2018年02月06日 07:15, Liu Bo wrote: > Btrfs tries its best to tolerate write errors, but kind of silently > (except some messages in kernel log). > > For raid1 and raid10, this is usually not a problem because there is a > copy as backup, while for parity based raid setup, i.e. raid5 and >

Re: [PATCH] btrfs: Add enospc_debug printing in metadata_reserve_bytes

2018-02-05 Thread Qu Wenruo
On 2018年02月06日 00:20, Nikolay Borisov wrote: > > > On 15.12.2017 12:05, Nikolay Borisov wrote: >> Currently when enoscp_debug mount option is turned on we do not print >> any debug info in case metadata reservation failures happen. Fix this >> by adding the necessary hook in

[PATCH v4 1/3] btrfs-progs: Add make testsuite command for export tests

2018-02-05 Thread Gu Jinxiang
Export the testsuite files to a separate tar. Since fsck tests depend on btrfs-corrupt-block, and misc tests depends on both btrfs-corrupt-block and fssum, so set it as prerequisites for package commad. Because, althougth fssum can be generated by source that are all in tests directory, and has

[PATCH v4 0/3] Add support for export testsuits

2018-02-05 Thread Gu Jinxiang
Achieved: 1. export testsuite by: $ make testsuite files list in testsuites-list will be added into tarball btrfs-progs-tests.tar.gz. 2. after decompress btrfs-progs-tests.tar.gz, run test by: $ TEST=`MASK` ./tests/mkfs-tests.sh and, without MASK also be ok. replenish: $ tar -xzvf

[PATCH v4 3/3] btrfs-progs: Add readme for export testsuits

2018-02-05 Thread Gu Jinxiang
Add the readme of command for export testsuits. And add the excute method of exported testsuits. Signed-off-by: Gu Jinxiang --- tests/README.md | 13 + 1 file changed, 13 insertions(+) diff --git a/tests/README.md b/tests/README.md index 04d2ce2a..23f35cfc

Re: [PATCH 2/2] btrfs: Remove custom crc32c init code

2018-02-05 Thread David Sterba
On Fri, Feb 02, 2018 at 09:46:40PM +0200, Andy Shevchenko wrote: > On Mon, Jan 8, 2018 at 11:45 AM, Nikolay Borisov wrote: > > The custom crc32 init code was introduced in > > 14a958e678cd ("Btrfs: fix btrfs boot when compiled as built-in") to > > enable using btrfs as a

Re: [PATCH 0/2] Remove custom crc32c init code from btrfs

2018-02-05 Thread David Sterba
On Mon, Jan 08, 2018 at 11:45:03AM +0200, Nikolay Borisov wrote: > So here is a small 2 patch set which removes btrfs' manual initialisation of > the lower level crc32c module. Explanation why is ok can be found in Patch > 2/2. > > Patch 1/2 just adds a function to the generic crc32c header

[PATCH 0/3] btrfs-progs: Split original mode check to its own

2018-02-05 Thread Qu Wenruo
This time, there are 2 patches too large to reach mail list, so please fetch the whole patchset from github as usual: https://github.com/adam900710/btrfs-progs/tree/split_check_part2 The branch is based on devel branch, whose HEAD is: commit 3aa1bbdd89ee9c9c48d260a6192fae08328f1b2f (david/devel)

[PATCH 3/3] btrfs-progs: Move check/main.c to cmds-check.c to maintain the subcommand hierarchy

2018-02-05 Thread Qu Wenruo
cmds-check.c is back now, with include files cleaned up. Signed-off-by: Qu Wenruo --- Makefile | 8 check/main.c => cmds-check.c | 17 - 2 files changed, 4 insertions(+), 21 deletions(-) rename check/main.c => cmds-check.c (97%)

[PATCH] btrfs-progs: fsck-tests: Cleanup the restored image for 028

2018-02-05 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- tests/fsck-tests/028-unaligned-super-dev-sizes/test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/fsck-tests/028-unaligned-super-dev-sizes/test.sh b/tests/fsck-tests/028-unaligned-super-dev-sizes/test.sh index

segmentation fault in btrfs tool v4.15

2018-02-05 Thread Ralph Gauges
Hi, I recently started using the btrfs file system on my backup disk and until a power failure during a backup everything seemed to work well. Due a power failure however, the file systems seems to have become corrupted and all trials to check or repair it so far have lead to a segmentation

Re: [PATCH v3] btrfs: print error if primary super block write fails

2018-02-05 Thread David Sterba
On Mon, Feb 05, 2018 at 02:45:21PM +0800, Anand Jain wrote: > On 02/05/2018 02:38 PM, Anand Jain wrote: > > On 02/03/2018 03:09 AM, Howard McLauchlan wrote: > >> Presently, failing a primary super block write but succeeding in at > >> least one super block write in general will appear to users as

Re: [PATCH v3] btrfs: print error if primary super block write fails

2018-02-05 Thread David Sterba
On Fri, Feb 02, 2018 at 11:19:59AM -0800, Howard McLauchlan wrote: > On 02/02/2018 11:09 AM, Howard McLauchlan wrote: > > Presently, failing a primary super block write but succeeding in at > > least one super block write in general will appear to users as if > > nothing important went wrong.