[PATCH 3/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
This fixes "btrfs inspect-internal dump-super --bytenr" Signed-off-by: Tomohiro Misono --- cmds-inspect-dump-super.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c index 98e0270..c7afd80 100644

[PATCH 2/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
This fixes "btrfs receive -E" Signed-off-by: Tomohiro Misono --- cmds-receive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-receive.c b/cmds-receive.c index 72e9c8f..e584cef 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -1277,7

[PATCH 1/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
I found some btrfs commands options are not working because of inappropriate getopt_long() setting. This fixes "btrfs check -Q/-E" Signed-off-by: Tomohiro Misono --- cmds-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-check.c

Re: [PATCH 1/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
Sorry, this patch's encoding is wrong. Please ignore this and I will resend the patch. On 2017/08/24 13:03, Misono, Tomohiro wrote: I found some btrfs commands options are not working because of inappropriate getopt_long() setting. This fixes "btrfs check -Q/-E" Signed-off-by: Tomohiro

[PATCH 1/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
I found some btrfs commands options are not working because of inappropriate getopt_long() setting. This fixes "btrfs check -Q/-E" Signed-off-by: Tomohiro Misono ---  cmds-check.c | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-check.c

Re: status of inline deduplication in btrfs

2017-08-23 Thread Tsutomu Itoh
On 2017/08/23 23:52, shally verma wrote: > HI > > Through btrfs wiki, I got to know about inline patch and this git > location https://github.com/adam900710/linux but I am not sure what's > progress and status on this. Could any one please confirm what is the > status of inline deduplication

[PATCH v6 4/6] Btrfs: heuristic add detection of repeated data patterns

2017-08-23 Thread Timofey Titovets
Walk over data sample and use memcmp to detect repeated data (like zeroed) Signed-off-by: Timofey Titovets --- fs/btrfs/heuristic.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/btrfs/heuristic.c b/fs/btrfs/heuristic.c index

[PATCH v6 1/6] Btrfs: heuristic make use compression workspaces

2017-08-23 Thread Timofey Titovets
Move heuristic to external file Implement compression workspaces support for heuristic resources Signed-off-by: Timofey Titovets --- fs/btrfs/heuristic.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/heuristic.c

[PATCH v6 2/6] Btrfs: heuristic workspace add bucket and sample items

2017-08-23 Thread Timofey Titovets
Heuristic workspace: - Add bucket for storing byte type counters - Add sample array for storing partial copy of input data range - Add counter for store current sample size to workspace Signed-off-by: Timofey Titovets --- fs/btrfs/heuristic.c | 23

[PATCH v6 3/6] Btrfs: implement heuristic sampling logic

2017-08-23 Thread Timofey Titovets
Copy sample data from input data range to sample buffer then calculate byte type count for that sample into bucket. Signed-off-by: Timofey Titovets --- fs/btrfs/heuristic.c | 38 +- 1 file changed, 37 insertions(+), 1 deletion(-) diff

[PATCH v6 6/6] Btrfs: heuristic add byte core set calculation

2017-08-23 Thread Timofey Titovets
Calculate byte core set for data sample: Sort bucket's numbers in decreasing order Count how many numbers use 90% of sample If core set are low (<=25%), data are easily compressible If core set high (>=80%), data are not compressible Signed-off-by: Timofey Titovets ---

[PATCH v6 0/6] Btrfs: populate heuristic with code

2017-08-23 Thread Timofey Titovets
Based on kdave for-next Patches short: 1. Move heuristic to use compression workspaces Bit tricky, but works. 2. Add heuristic counters and buffer to workspaces 3. Implement simple input data sampling It's get 16 byte samples with 256 bytes shifts over input data. Collect info about

[PATCH v6 5/6] Btrfs: heuristic add byte set calculation

2017-08-23 Thread Timofey Titovets
Calculate byte set size for data sample: Calculate how many unique bytes has been in sample By count all bytes in bucket with count > 0 If byte set low (~25%), data are easily compressible Signed-off-by: Timofey Titovets --- fs/btrfs/heuristic.c | 26

Re: [RFC v3 0/2] vfs / btrfs: add support for ustat()

2017-08-23 Thread Jeff Mahoney
On 8/15/14 5:29 AM, Al Viro wrote: > On Thu, Aug 14, 2014 at 07:58:56PM -0700, Luis R. Rodriguez wrote: > >> Christoph had noted that this seemed associated to the problem >> that the btrfs uses different assignments for st_dev than s_dev, >> but much as I'd like to see that changed based on

Re: user snapshots

2017-08-23 Thread Ulli Horlacher
On Wed 2017-08-23 (12:42), Peter Grandi wrote: > > So, still: What is the problem with user_subvol_rm_allowed? > > As usual, it is complicated: mostly that while subvol creation > is very cheap, subvol deletion can be very expensive. But then > so can be creating many snapshots, as in this: But

Re: number of subvolumes

2017-08-23 Thread Ferry Toth
Op Wed, 23 Aug 2017 10:37:07 +0200, schreef A L: > From: Ulli Horlacher -- Sent: > 2017-08-23 - 09:18 > >> On Tue 2017-08-22 (22:48), Ulli Horlacher wrote: >> >>> > Assumptions that all Btrfs features such as snapshots are infinitely >>> > scalable at

Re: [PATCH v5 4/6] Btrfs: heuristic add detection of zeroed sample

2017-08-23 Thread Timofey Titovets
2017-08-23 20:55 GMT+03:00 Diego Calleja : > El miércoles, 23 de agosto de 2017 2:26:48 (CEST) Timofey Titovets escribió: >> + for (i = 0; i < workspace->sample_size; i += sizeof(zero)) { >> + if (memcmp(>sample[i], , sizeof(zero))) >> +

Re: [PATCH 1/7] Btrfs: fix blk_status_t/errno confusion

2017-08-23 Thread Omar Sandoval
On Wed, Aug 23, 2017 at 10:13:40AM -0600, Liu Bo wrote: > On Tue, Aug 22, 2017 at 11:45:59PM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > This fixes several instances of blk_status_t and bare errno ints being > > mixed up, some of which are real bugs. > > > >

[PATCH] Btrfs: do not reset bio->bi_ops while writing bio

2017-08-23 Thread Liu Bo
flush_epd_write_bio() sets bio->bi_ops by itself to honor REQ_SYNC, but it's not needed at all since bio->bi_ops has set up properly in both __extent_writepage() and write_one_eb(), and in the case of write_one_eb(), it also sets REQ_META, which we will lose in flush_epd_write_bio(). This remove

Re: don't require a struct block_device to submit a bio

2017-08-23 Thread Jens Axboe
On 08/23/2017 11:10 AM, Christoph Hellwig wrote: > Hi Jens, > > this series removes the need to have a struct block_device ready to > submit a bio. We basically don't use it anywhere in the block stack > anyway - we always go for the gendisk or request_queue. The only > exception is partition

Re: [PATCH 1/6] btrfs: index check-integrity state hash by a dev_t

2017-08-23 Thread Liu Bo
On Wed, Aug 23, 2017 at 07:10:27PM +0200, Christoph Hellwig wrote: > We won't have the struct block_device available in the bio soon, so switch > to the numerical dev_t instead of the block_device pointer for looking up > the check-integrity state. Reviewed-by: Liu Bo

Re: [PATCH 2/6] raid5: remove a call to get_start_sect

2017-08-23 Thread Shaohua Li
On Wed, Aug 23, 2017 at 07:10:28PM +0200, Christoph Hellwig wrote: > The block layer always remaps partitions before calling into the > ->make_request methods of drivers. Thus the call to get_start_sect in > in_chunk_boundary will always return 0 and can be removed. > > Signed-off-by: Christoph

Re: don't require a struct block_device to submit a bio

2017-08-23 Thread Jens Axboe
On 08/23/2017 11:10 AM, Christoph Hellwig wrote: > Hi Jens, > > this series removes the need to have a struct block_device ready to > submit a bio. We basically don't use it anywhere in the block stack > anyway - we always go for the gendisk or request_queue. The only > exception is partition

Re: don't require a struct block_device to submit a bio

2017-08-23 Thread Christoph Hellwig
Patch 6 didn't seem to make it through to the list, so here is a link to the git tree: http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/bi_bdev -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH v5 4/6] Btrfs: heuristic add detection of zeroed sample

2017-08-23 Thread Diego Calleja
El miércoles, 23 de agosto de 2017 2:26:48 (CEST) Timofey Titovets escribió: > + for (i = 0; i < workspace->sample_size; i += sizeof(zero)) { > + if (memcmp(>sample[i], , sizeof(zero))) > + return false; Instead of just checking for 0, wouldn't it be a better

[RFC PATCH] Btrfs: clear_dirty only on pages in compression range

2017-08-23 Thread Timofey Titovets
At now while compressing data range code touch dirty page status on whole range on each 128kb iteration, that's costs time As we care only about page status in range that will be compressed in current iteration, let's touch dirty status only for actual compression range Signed-off-by: Timofey

Re: [PATCH 1/7] Btrfs: fix blk_status_t/errno confusion

2017-08-23 Thread Liu Bo
On Tue, Aug 22, 2017 at 11:45:59PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > This fixes several instances of blk_status_t and bare errno ints being > mixed up, some of which are real bugs. > > Fixes: 4e4cbee93d56 ("block: switch bios to blk_status_t") >

Re: [PATCH 3/3] btrfs-progs: fsck-test: case for corrupted dir item name

2017-08-23 Thread David Sterba
On Fri, Jul 14, 2017 at 03:47:46PM +0800, Su Yue wrote: > In this test case, all name in dir_item, dir_index, inode_ref > are corrupted to another one. > btrfs check should report errors about the corrupted dir_item but > btrfs can't repair the case now. > > Signed-off-by: Su Yue

[PATCH 4/6] block: add a __disk_get_part helper

2017-08-23 Thread Christoph Hellwig
This helper allows looking up a partion under RCU protection without grabbing a reference to it. Signed-off-by: Christoph Hellwig --- block/blk.h | 2 ++ block/genhd.c | 26 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/block/blk.h

[PATCH 2/6] raid5: remove a call to get_start_sect

2017-08-23 Thread Christoph Hellwig
The block layer always remaps partitions before calling into the ->make_request methods of drivers. Thus the call to get_start_sect in in_chunk_boundary will always return 0 and can be removed. Signed-off-by: Christoph Hellwig --- drivers/md/raid5.c | 4 +++- 1 file changed, 3

[PATCH 5/6] block: cache the partition index in struct block_device

2017-08-23 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 1 + include/linux/fs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/block_dev.c b/fs/block_dev.c index 9941dc8342df..d29d1c70f833 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1451,6 +1451,7 @@ static int

don't require a struct block_device to submit a bio

2017-08-23 Thread Christoph Hellwig
Hi Jens, this series removes the need to have a struct block_device ready to submit a bio. We basically don't use it anywhere in the block stack anyway - we always go for the gendisk or request_queue. The only exception is partition remapping for which we'll now need an additional partition

[PATCH 1/6] btrfs: index check-integrity state hash by a dev_t

2017-08-23 Thread Christoph Hellwig
We won't have the struct block_device available in the bio soon, so switch to the numerical dev_t instead of the block_device pointer for looking up the check-integrity state. Signed-off-by: Christoph Hellwig --- fs/btrfs/check-integrity.c | 31 +-- 1

[PATCH 3/6] block: reject attempts to allocate more than DISK_MAX_PARTS partitions

2017-08-23 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- block/genhd.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/genhd.c b/block/genhd.c index 2367087cdb7c..3380a1e73ea0 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1357,6 +1357,13 @@ struct gendisk *alloc_disk_node(int

Re: [PATCH 1/7] Btrfs: fix blk_status_t/errno confusion

2017-08-23 Thread David Sterba
On Tue, Aug 22, 2017 at 11:45:59PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > This fixes several instances of blk_status_t and bare errno ints being > mixed up, some of which are real bugs. Reviewed-by: David Sterba The real bugs are lurking in the

Re: [PATCH 00/14 RFC] Btrfs: Add journal for raid5/6 writes

2017-08-23 Thread Austin S. Hemmelgarn
On 2017-08-23 11:28, Chris Murphy wrote: On Wed, Aug 2, 2017 at 2:27 PM, Liu Bo wrote: On Wed, Aug 02, 2017 at 10:41:30PM +0200, Goffredo Baroncelli wrote: What I want to understand, is if it is possible to log only the "partial stripe" RMW cycle. I think your

Re: [PATCH 00/14 RFC] Btrfs: Add journal for raid5/6 writes

2017-08-23 Thread Chris Murphy
On Wed, Aug 2, 2017 at 2:27 PM, Liu Bo wrote: > On Wed, Aug 02, 2017 at 10:41:30PM +0200, Goffredo Baroncelli wrote: >> What I want to understand, is if it is possible to log only the "partial >> stripe" RMW cycle. >> > > I think your point is valid if all data is written

Re: [PATCH v2 0/3] Introduce comprehensive sanity check framework and

2017-08-23 Thread Nikolay Borisov
On 23.08.2017 10:57, Qu Wenruo wrote: > The patchset introduce a new framework to do more comprehensive (if not > the most) sanity check when reading out a leaf. > > The new sanity checker will include: > > 1) Key order >Existing code > > 2) Item boundary >Existing code with enhanced

status of inline deduplication in btrfs

2017-08-23 Thread shally verma
HI Through btrfs wiki, I got to know about inline patch and this git location https://github.com/adam900710/linux but I am not sure what's progress and status on this. Could any one please confirm what is the status of inline deduplication into btrfs and if it is the correct location to see its

Re: finding root filesystem of a subvolume?

2017-08-23 Thread Axel Burri
On 2017-08-23 14:07, Austin S. Hemmelgarn wrote: > On 2017-08-22 13:41, Peter Grandi wrote: > [ ... ] >> This stupid point relies on ignoring that it is not mandatory to >> mount the main volume, and that therefore "There is no fixed >> relationship between the root directory inode of a subvolume

Re: degraded BTRFS RAID 1 not mountable: open_ctree failed, unable to find block group for 0

2017-08-23 Thread g6094199
> -Ursprüngliche Nachricht- > Von: Dmitrii Tcvetkov > Gesendet: Di. 22.08.2017 12:28 > An: g6094...@freenet.de > Kopie: linux-btrfs@vger.kernel.org > Betreff: Re: degraded BTRFS RAID 1 not mountable: open_ctree failed, unable > to find block group for 0 > > On Tue, 22 Aug 2017 11:31:23

Re: number of subvolumes

2017-08-23 Thread Peter Grandi
> This is a vanilla SLES12 installation: [ ... ] Why does SUSE > ignore this "not too many subvolumes" warning? As in many cases with Btrfs "it's complicated" because of the interaction of advanced features among themselves and the chosen implementation and properties of storage; anisotropy

Re: user snapshots

2017-08-23 Thread Peter Grandi
> So, still: What is the problem with user_subvol_rm_allowed? As usual, it is complicated: mostly that while subvol creation is very cheap, subvol deletion can be very expensive. But then so can be creating many snapshots, as in this: https://www.spinics.net/lists/linux-btrfs/msg62760.html

Re: finding root filesystem of a subvolume?

2017-08-23 Thread Austin S. Hemmelgarn
On 2017-08-22 13:41, Peter Grandi wrote: [ ... ] There is no fixed relationship between the root directory inode of a subvolume and the root directory inode of any other subvolume or the main volume. Actually, there is, because it's inherently rooted in the hierarchy of the volume itself.

Re: number of subvolumes

2017-08-23 Thread A L
From: Ulli Horlacher -- Sent: 2017-08-23 - 09:18 > On Tue 2017-08-22 (22:48), Ulli Horlacher wrote: > >> > Assumptions that all Btrfs features such as snapshots are >> > infinitely scalable at no cost may be optimistic: >> > >> > >> >

[PATCH v2 1/4] btrfs: Refactor check_leaf function for later expansion.

2017-08-23 Thread Qu Wenruo
Current check_leaf() function does a good job checking key orders and item offset/size. However it only checks from slot 0 to the last but one slot, this is good but makes later expansion hard. So this refactoring iterates from slot 0 to the last slot. For key comparison, it uses a key with all

[PATCH v2 2/4] btrfs: Check if item pointer overlap with item itself

2017-08-23 Thread Qu Wenruo
Function check_leaf() checks if any item pointer points outside of the leaf, but it doesn't check if the pointer overlap with the item itself. Normally only the last item may be the victim, but adding such check is never a bad idea anyway. Signed-off-by: Qu Wenruo ---

[PATCH v2 0/3] Introduce comprehensive sanity check framework and

2017-08-23 Thread Qu Wenruo
The patchset introduce a new framework to do more comprehensive (if not the most) sanity check when reading out a leaf. The new sanity checker will include: 1) Key order Existing code 2) Item boundary Existing code with enhanced checker to ensure item pointer doesn't overlap with item

[PATCH v2 4/4] btrfs: Add checker for EXTENT_CSUM

2017-08-23 Thread Qu Wenruo
EXTENT_CSUM checker is a relatively easy checker, only needs to check: 1) Objectid Fixed to BTRFS_EXTENT_CSUM_OBJECTID. 2) Key offset alignment Must be aligned to sectorsize 3) Item size alignedment Must be aligned to csum size. Signed-off-by: Qu Wenruo ---

[PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-08-23 Thread Qu Wenruo
Add extra checker for item with EXTENT_DATA type. This checks the following thing: 0) Key offset All key offset must be aligned to sectorsize. Inline extent must have 0 for key offset. 1) Item size Plain text inline file extent size must match item size. (compressed inline file extent

Re: user snapshots

2017-08-23 Thread Ulli Horlacher
On Wed 2017-08-23 (10:16), Dmitrii Tcvetkov wrote: > > >Also in https://btrfs.wiki.kernel.org/index.php/Mount_options > > >"user_subvol_rm_allowed (...) Use with caution." > > > > > >Why? What is the problem? > > > > Because with the mount option any user can delete any subvolume, > > including

number of subvolumes

2017-08-23 Thread Ulli Horlacher
On Tue 2017-08-22 (22:48), Ulli Horlacher wrote: > > Assumptions that all Btrfs features such as snapshots are > > infinitely scalable at no cost may be optimistic: > > > > > > https://btrfs.wiki.kernel.org/index.php/Gotchas#Having_many_subvolumes_can_be_very_slow > > "when you do device

Re: user snapshots

2017-08-23 Thread Dmitrii Tcvetkov
> >Also in https://btrfs.wiki.kernel.org/index.php/Mount_options > >"user_subvol_rm_allowed (...) Use with caution." > > > >Why? What is the problem? > > Because with the mount option any user can delete any subvolume, > including root one (subvol_id=5) Apologies, it works somewhat different:

[PATCH 4/7] Btrfs: refactor btrfs_device->name updates

2017-08-23 Thread Omar Sandoval
From: Omar Sandoval The rcu_string API introduced some new sparse errors but also revealed existing ones. First of all, the name in struct btrfs_device should be annotated as __rcu to prevent unsafe reads. Additionally, updates should go through rcu_dereference_protected to make

[PATCH 2/7] Btrfs: fix incorrect {node,sector}size endianness from BTRFS_IOC_FS_INFO

2017-08-23 Thread Omar Sandoval
From: Omar Sandoval fs_info->super_copy->{node,sector}size are little-endian, but the ioctl should return the values in native endianness. Use the cached values in btrfs_fs_info instead. Found with sparse. Fixes: 80a773fbfc2d ("btrfs: retrieve more info from FS_INFO ioctl")

[PATCH 7/7] Btrfs: fix __user casting in ioctl.c

2017-08-23 Thread Omar Sandoval
From: Omar Sandoval Signed-off-by: Omar Sandoval --- fs/btrfs/ioctl.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index cf71d0304671..7a7a82e0963c 100644 --- a/fs/btrfs/ioctl.c +++

[PATCH 3/7] Move Btrfs RCU string to common library

2017-08-23 Thread Omar Sandoval
From: Omar Sandoval The RCU-friendly string API used internally by Btrfs is generic enough for common use. This doesn't add any new functionality but instead just moves the code and documents the existing API. Reviewed-by: Josh Triplett Acked-by: Paul E.

[PATCH 6/7] Btrfs: make some volumes.c functions static

2017-08-23 Thread Omar Sandoval
From: Omar Sandoval These aren't used outside of volumes.c. Signed-off-by: Omar Sandoval --- fs/btrfs/volumes.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH 5/7] Btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO

2017-08-23 Thread Omar Sandoval
From: Omar Sandoval A naked read of the value of an RCU pointer isn't safe. Put the whole access in an RCU critical section, not just the pointer dereference. Signed-off-by: Omar Sandoval --- fs/btrfs/ioctl.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH 0/7] Btrfs: bugs found by sparse and RCU strings

2017-08-23 Thread Omar Sandoval
From: Omar Sandoval I came across my ancient RCU string branch [1] and decided to revive it and finally put it to rest. In the process of checking it with sparse, I found a handful of other issues. Patch 1 should probably go in 4.13, as it fixes bugs introduced this cycle by the

[PATCH 1/7] Btrfs: fix blk_status_t/errno confusion

2017-08-23 Thread Omar Sandoval
From: Omar Sandoval This fixes several instances of blk_status_t and bare errno ints being mixed up, some of which are real bugs. Fixes: 4e4cbee93d56 ("block: switch bios to blk_status_t") Signed-off-by: Omar Sandoval --- fs/btrfs/disk-io.c | 4 ++--

Re: user snapshots

2017-08-23 Thread Dmitrii Tcvetkov
>Also in https://btrfs.wiki.kernel.org/index.php/Mount_options >"user_subvol_rm_allowed (...) Use with caution." > >Why? What is the problem? Because with the mount option any user can delete any subvolume, including root one (subvol_id=5) -- To unsubscribe from this list: send the line