Re: [PATCH 2/4] dm crypt: Fix zoned block device support

2021-04-16 Thread Johannes Thumshirn
On 16/04/2021 05:05, Damien Le Moal wrote: [...] > + CRYPT_IV_NO_SECTORS,/* IV calculation does not use sectors > */ [...] > - if (ivmode == NULL) > + if (ivmode == NULL) { > cc->iv_gen_ops = NULL; > - else if (strcmp(ivmode, "plain") == 0) > +

Re: [PATCH 2/4] dm crypt: Fix zoned block device support

2021-04-16 Thread Damien Le Moal
On 2021/04/16 16:13, Johannes Thumshirn wrote: > On 16/04/2021 05:05, Damien Le Moal wrote: > > [...] > >> +CRYPT_IV_NO_SECTORS,/* IV calculation does not use sectors >> */ > > [...] > >> -if (ivmode == NULL) >> +if (ivmode == NULL) { >> cc->iv_gen_ops = NU

Re: [PATCH 2/4] dm crypt: Fix zoned block device support

2021-04-16 Thread Johannes Thumshirn
On 16/04/2021 09:30, Damien Le Moal wrote: > On 2021/04/16 16:13, Johannes Thumshirn wrote: >> On 16/04/2021 05:05, Damien Le Moal wrote: >> >> [...] >> >>> + CRYPT_IV_NO_SECTORS,/* IV calculation does not use sectors >>> */ >> >> [...] >> >>> - if (ivmode == NULL) >>> + if (ivmo

Re: [PATCH v4 1/3] btrfs: zoned: reset zones of relocated block groups

2021-04-16 Thread Filipe Manana
On Thu, Apr 15, 2021 at 3:00 PM Johannes Thumshirn wrote: > > When relocating a block group the freed up space is not discarded in one > big block, but each extent is discarded on it's own with -odisard=sync. > > For a zoned filesystem we need to discard the whole block group at once, > so btrfs_d

Re: [PATCH v4 1/3] btrfs: zoned: reset zones of relocated block groups

2021-04-16 Thread Johannes Thumshirn
On 16/04/2021 11:12, Filipe Manana wrote: > On Thu, Apr 15, 2021 at 3:00 PM Johannes Thumshirn > wrote: >> >> When relocating a block group the freed up space is not discarded in one >> big block, but each extent is discarded on it's own with -odisard=sync. >> >> For a zoned filesystem we need to

Re: [PATCH v4 2/3] btrfs: rename delete_unused_bgs_mutex

2021-04-16 Thread Filipe Manana
On Thu, Apr 15, 2021 at 3:00 PM Johannes Thumshirn wrote: > > As a preparation for another user, rename the unused_bgs_mutex into > reclaim_bgs_lock. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Filipe Manana Looks good, thanks. > --- > fs/btrfs/block-group.c | 6 +++--- > fs/btrfs/ct

Re: [PATCH v4 3/3] btrfs: zoned: automatically reclaim zones

2021-04-16 Thread Filipe Manana
On Thu, Apr 15, 2021 at 3:00 PM Johannes Thumshirn wrote: > > When a file gets deleted on a zoned file system, the space freed is not > returned back into the block group's free space, but is migrated to > zone_unusable. > > As this zone_unusable space is behind the current write pointer it is not

Re: [PATCH v4 1/3] btrfs: zoned: reset zones of relocated block groups

2021-04-16 Thread Filipe Manana
On Fri, Apr 16, 2021 at 10:14 AM Johannes Thumshirn wrote: > > On 16/04/2021 11:12, Filipe Manana wrote: > > On Thu, Apr 15, 2021 at 3:00 PM Johannes Thumshirn > > wrote: > >> > >> When relocating a block group the freed up space is not discarded in one > >> big block, but each extent is discarde

Re: [PATCH v4 1/3] btrfs: zoned: reset zones of relocated block groups

2021-04-16 Thread Johannes Thumshirn
On 16/04/2021 11:30, Filipe Manana wrote: > The comment refers to deleting the device extent items from the device > tree, not really extents on disk. > I.e. it's all about the items from the block group in the chunk and > device trees. OK I'll move it back where it was.

Re: Dead fs on 2 Fedora systems: block=57084067840 write time tree block corruption detected

2021-04-16 Thread David Sterba
On Thu, Apr 15, 2021 at 11:06:32AM -0600, Chris Murphy wrote: > First computer/file system: > > (from the photo): > > [ 136.259984] BTRFS critical (device nvme0n1p8): corrupt leaf: root=257 > block=31259951104 slot=9 ino=3244515, name hash mismatch with key, have > 0xF22F547D expect 0x0

Re: [PATCH 04/42] btrfs: introduce submit_eb_subpage() to submit a subpage metadata page

2021-04-16 Thread Josef Bacik
On 4/15/21 7:28 PM, Qu Wenruo wrote: On 2021/4/16 上午3:27, Josef Bacik wrote: On 4/15/21 1:04 AM, Qu Wenruo wrote: The new function, submit_eb_subpage(), will submit all the dirty extent buffers in the page. The major difference between submit_eb_page() and submit_eb_subpage() is: - How to gr

Re: [PATCH 02/42] btrfs: introduce write_one_subpage_eb() function

2021-04-16 Thread Josef Bacik
On 4/15/21 7:25 PM, Qu Wenruo wrote: On 2021/4/16 上午3:03, Josef Bacik wrote: On 4/15/21 1:04 AM, Qu Wenruo wrote: The new function, write_one_subpage_eb(), as a subroutine for subpage metadata write, will handle the extent buffer bio submission. The major differences between the new write_on

Re: [PATCH 05/42] btrfs: remove the unused parameter @len for btrfs_bio_fits_in_stripe()

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: The parameter @len is not really used in btrfs_bio_fits_in_stripe(), just remove it. Signed-off-by: Qu Wenruo Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH 06/42] btrfs: allow btrfs_bio_fits_in_stripe() to accept bio without any page

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Function btrfs_bio_fits_in_stripe() now requires a bio with at least one page added. Or btrfs_get_chunk_map() will fail with -ENOENT. But in fact this requirement is not needed at all, as we can just pass sectorsize for btrfs_get_chunk_map(). This tiny behav

Re: [PATCH 07/42] btrfs: use u32 for length related members of btrfs_ordered_extent

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Unlike btrfs_file_extent_item, btrfs_ordered_extent has its length limit (BTRFS_MAX_EXTENT_SIZE), which is far smaller than U32_MAX. Using u64 for those length related members are just a waste of memory. This patch will make the following members u32: - num_

Re: [PATCH 08/42] btrfs: pass btrfs_inode into btrfs_writepage_endio_finish_ordered()

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: There is a pretty bad abuse of btrfs_writepage_endio_finish_ordered() in end_compressed_bio_write(). It passes compressed pages to btrfs_writepage_endio_finish_ordered(), which is only supposed to accept inode pages. Thankfully the important info here is the

Re: [PATCH 09/42] btrfs: refactor how we finish ordered extent io for endio functions

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Btrfs has two endio functions to mark certain io range finished for ordered extents: - __endio_write_update_ordered() This is for direct IO - btrfs_writepage_endio_finish_ordered() This for buffered IO. However they go different routines to handle orde

Re: [PATCH 10/42] btrfs: update the comments in btrfs_invalidatepage()

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: The existing comments in btrfs_invalidatepage() don't really get to the point, especially for what Private2 is really representing and how the race avoidance is done. The truth is, there are only three entrances to do ordered extent accounting: - btrfs_writep

Re: [PATCH 11/42] btrfs: refactor btrfs_invalidatepage()

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: This patch will refactor btrfs_invalidatepage() for the incoming subpage support. The invovled modifcations are: - Use while() loop instead of "goto again;" - Use single variable to determine whether to delete extent states Each branch will also have comme

Re: [PATCH 12/42] btrfs: make Private2 lifespan more consistent

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Currently btrfs uses page Private2 bit to incidate if we have ordered extent for the page range. But the lifespan of it is not consistent, during regular writeback path, there are two locations to clear the same PagePrivate2: T - Page marked Dirty

Re: [PATCH 13/42] btrfs: rename PagePrivate2 to PageOrdered inside btrfs

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Inside btrfs, we use Private2 page status to indicate we have ordered extent with pending IO for the sector. But the page status name, Private2, tells us nothing about the bit itself, so this patch will rename it to Ordered. And with extra comment about the b

Re: [PATCH 14/42] btrfs: pass bytenr directly to __process_pages_contig()

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: As a preparation for incoming subpage support, we need bytenr passed to __process_pages_contig() directly, not the current page index. So change the parameter and all callers to pass bytenr in. With the modification, here we need to replace the old @index_re

Re: [PATCH 15/42] btrfs: refactor the page status update into process_one_page()

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: In __process_pages_contig() we update page status according to page_ops. That update process is a bunch of if () {} branches, which lies inside two loops, this makes it pretty hard to expand for later subpage operations. So this patch will extract this opera

Re: [PATCH 16/42] btrfs: provide btrfs_page_clamp_*() helpers

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: In the coming subpage RW supports, there are a lot of page status update calls which need to be converted to subpage compatible version, which needs @start and @len. Some call sites already have such @start/@len and are already in page range, like various end

Re: [PATCH 17/42] btrfs: only require sector size alignment for end_bio_extent_writepage()

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Just like read page, for subpage support we only require sector size alignment. So change the error message condition to only require sector alignment. This should not affect existing code, as for regular sectorsize == PAGE_SIZE case, we are still requiring

Re: [PATCH 18/42] btrfs: make btrfs_dirty_pages() to be subpage compatible

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Since the extent io tree operations in btrfs_dirty_pages() are already subpage compatible, we only need to make the page status update to use subpage helpers. Signed-off-by: Qu Wenruo Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH 19/42] btrfs: make __process_pages_contig() to handle subpage dirty/error/writeback status

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: For __process_pages_contig() and process_one_page(), to handle subpage we only need to pass bytenr in and call subpage helpers to handle dirty/error/writeback status. Signed-off-by: Qu Wenruo Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH 20/42] btrfs: make end_bio_extent_writepage() to be subpage compatible

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Now in end_bio_extent_writepage(), the only subpage incompatible code is the end_page_writeback(). Just call the subpage helpers. Signed-off-by: Qu Wenruo Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH 21/42] btrfs: make process_one_page() to handle subpage locking

2021-04-16 Thread Josef Bacik
On 4/15/21 1:04 AM, Qu Wenruo wrote: Introduce a new data inodes specific subpage member, writers, to record how many sectors are under page lock for delalloc writing. This member acts pretty much the same as readers, except it's only for delalloc writes. This is important for delalloc code to

Re: [PATCH v2 2/3] blkid: add magic and probing for zoned btrfs

2021-04-16 Thread David Sterba
On Wed, Apr 14, 2021 at 10:33:38AM +0900, Naohiro Aota wrote: > It also supports temporary magic ("!BHRfS_M") in zone #0. The mkfs.btrfs > first writes the temporary superblock to the zone during the mkfs process. > It will survive there until the zones are filled up and reset. So, we also > need t

Re: [PATCH v2 3/3] blkid: support zone reset for wipefs

2021-04-16 Thread David Sterba
On Wed, Apr 14, 2021 at 03:57:42PM +0200, Karel Zak wrote: > On Wed, Apr 14, 2021 at 10:33:39AM +0900, Naohiro Aota wrote: > > /** > > * blkid_do_wipe: > > * @pr: prober > > @@ -1267,6 +1310,7 @@ int blkid_do_wipe(blkid_probe pr, int dryrun) > > const char *off = NULL; > > size_t len =

Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append

2021-04-16 Thread David Sterba
On Fri, Apr 16, 2021 at 12:05:27PM +0900, Damien Le Moal wrote: > From: Johannes Thumshirn > > For zoned btrfs, zone append is mandatory to write to a sequential write > only zone, otherwise parallel writes to the same zone could result in > unaligned write errors. > > If a zoned block device do

Re: [PATCH v4 2/3] btrfs: rename delete_unused_bgs_mutex

2021-04-16 Thread David Sterba
On Thu, Apr 15, 2021 at 10:58:34PM +0900, Johannes Thumshirn wrote: > --- a/fs/btrfs/ctree.h > +++ b/fs/btrfs/ctree.h > @@ -957,7 +957,7 @@ struct btrfs_fs_info { > spinlock_t unused_bgs_lock; > struct list_head unused_bgs; > struct mutex unused_bg_unpin_mutex; > - struct mute

Re: [PATCH v4 3/3] btrfs: zoned: automatically reclaim zones

2021-04-16 Thread David Sterba
On Thu, Apr 15, 2021 at 10:58:35PM +0900, Johannes Thumshirn wrote: > --- a/fs/btrfs/ctree.h > +++ b/fs/btrfs/ctree.h > @@ -954,10 +954,14 @@ struct btrfs_fs_info { > struct work_struct async_data_reclaim_work; > struct work_struct preempt_reclaim_work; > > + /* Used to reclaim da

Re: [PATCH v4 3/3] btrfs: zoned: automatically reclaim zones

2021-04-16 Thread David Sterba
On Thu, Apr 15, 2021 at 10:58:35PM +0900, Johannes Thumshirn wrote: > @@ -2974,6 +2982,9 @@ void btrfs_init_fs_info(struct btrfs_fs_info *fs_info) > fs_info->swapfile_pins = RB_ROOT; > > fs_info->send_in_progress = 0; > + > + fs_info->bg_reclaim_threshold = 75; The value should b

Re: [PATCH v3 00/13] btrfs: support read-write for subpage metadata

2021-04-16 Thread riteshh
On 21/04/16 02:14PM, Qu Wenruo wrote: > > > On 2021/4/16 下午1:50, riteshh wrote: > > On 21/04/16 09:34AM, Qu Wenruo wrote: > > > > > > > > > On 2021/4/16 上午7:34, Qu Wenruo wrote: > > > > > > > > > > > > On 2021/4/16 上午7:19, Qu Wenruo wrote: > > > > > > > > > > > > > > > On 2021/4/15 下午10:52, riteshh

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

2021-04-16 Thread Neal Gompa
On Thu, Apr 15, 2021 at 2:29 PM Luis Chamberlain wrote: > > On Thu, Apr 15, 2021 at 02:17:58PM -0400, Josef Bacik wrote: > > There's a lot of larger things that need to > > be addressed in general to support the volume approach inside file systems > > that is going to require a lot of work inside

Re: [PATCH-next] fs/btrfs: Fix uninitialized variable

2021-04-16 Thread David Sterba
On Tue, Apr 13, 2021 at 02:06:04PM +0100, Khaled ROMDHANI wrote: > The variable zone is not initialized. It > may causes a failed assertion. Failed assertion means the 2nd one checking that the result still fits to 32bit type. That would mean that none of the cases were hit, but all callers pass v

Re: [PATCH] btrfs-progs: mark BUG() as unreachable

2021-04-16 Thread David Sterba
On Thu, Apr 01, 2021 at 05:41:00PM +0900, Naohiro Aota wrote: > Marking BUG() unreachable helps us silence unnecessary warnings e.g. > "warning: control reaches end of non-void function [-Wreturn-type]" like > the code below. > >int foo() >{ >... > if (XXX) > return

Re: [PATCH] btrfs-progs: tests: add misc test for enqueue parameter

2021-04-16 Thread Boris Burkov
On Wed, Apr 14, 2021 at 03:49:06PM +0800, An Long wrote: > The exclusive ops will not start if there's one already running. The > enqueue parameter allows operations to be queued. > > Signed-off-by: An Long > --- > .../misc-tests/048-enqueue-parameter/test.sh | 52 +++ > 1 file

Re: [PATCH 2/3] btrfs-progs: image: enlarge the output file if no tree modification is needed for restore

2021-04-16 Thread David Sterba
On Fri, Mar 26, 2021 at 08:50:46PM +0800, Qu Wenruo wrote: > [BUG] > If restoring dumpped image into a new file, under most cases kernel will > reject it: > > # mkfs.btrfs -f /dev/test/test > # btrfs-image /dev/test/test /tmp/dump > # btrfs-image -r /tmp/dump ~/test.img > # mount ~/test.img /m

Re: [PATCH 3/3] btrfs-progs: misc-tests: add test to ensure the restored image can be mounted

2021-04-16 Thread David Sterba
On Fri, Mar 26, 2021 at 08:50:47PM +0800, Qu Wenruo wrote: > This new test case is to make sure the restored image file has been > properly enlarged so that newer kernel won't complain. > > Signed-off-by: Qu Wenruo > --- > .../047-image-restore-mount/test.sh | 19 +++ >

Re: [PATCH] btrfs-progs: mkfs: only output the warning if the sectorsize is not supported

2021-04-16 Thread David Sterba
On Thu, Apr 15, 2021 at 01:30:11PM +0800, Qu Wenruo wrote: > Currently mkfs.btrfs will output a warning message if the sectorsize is > not the same as page size: > WARNING: the filesystem may not be mountable, sectorsize 4096 doesn't match > page size 65536 > > But since btrfs subpage support f

Re: [PATCH] btrfs-progs: mkfs: only output the warning if the sectorsize is not supported

2021-04-16 Thread Boris Burkov
On Thu, Apr 15, 2021 at 01:30:11PM +0800, Qu Wenruo wrote: > Currently mkfs.btrfs will output a warning message if the sectorsize is > not the same as page size: > WARNING: the filesystem may not be mountable, sectorsize 4096 doesn't match > page size 65536 > > But since btrfs subpage support f

Re: [PATCH] btrfs-progs: Fix null pointer deref in balance_level

2021-04-16 Thread David Sterba
On Tue, Apr 06, 2021 at 04:55:03PM +0300, Nikolay Borisov wrote: > In case the right buffer is emptied it's first set to null and > subsequently it's dereferenced to get its size to pass to root_sub_used. > This naturally leads to a null pointer dereference. The correct thing > to do is to pass the

Re: [PATCH 0/1] btrfs-progs: libbtrfsutil: Relicense to LGPLv2.1+

2021-04-16 Thread David Sterba
On Tue, Mar 30, 2021 at 09:21:40AM -0400, Neal Gompa wrote: > On Tue, Mar 23, 2021 at 11:53 AM David Sterba wrote: > > > > On Wed, Mar 17, 2021 at 04:01:43PM -0400, Neal Gompa wrote: > > > This is a patch requesting all substantial copyright owners to sign off > > > on changing the license of the

read time tree block corruption detected

2021-04-16 Thread Gervais, Francois
We are using btrfs on one of our embedded devices and we got filesystem corruption on one of them. This product undergo a lot of tests on our side and apparently it's the first it happened so it seems to be a pretty rare occurrence. However we still want to get to the bottom of this to ensure i

Re: [PATCH] btrfs-progs: mkfs: only output the warning if the sectorsize is not supported

2021-04-16 Thread David Sterba
On Fri, Apr 16, 2021 at 11:14:08AM -0700, Boris Burkov wrote: > On Thu, Apr 15, 2021 at 01:30:11PM +0800, Qu Wenruo wrote: > > +/* > > + * The buffer size if strlen("4096 8192 16384 32768 65536"), > > + * which is 28, then round up to 32. > > I think there is a typo in this comment, because it doe

Re: [PATCH] btrfs-progs: mkfs: only output the warning if the sectorsize is not supported

2021-04-16 Thread Boris Burkov
On Fri, Apr 16, 2021 at 10:07:09PM +0200, David Sterba wrote: > On Fri, Apr 16, 2021 at 11:14:08AM -0700, Boris Burkov wrote: > > On Thu, Apr 15, 2021 at 01:30:11PM +0800, Qu Wenruo wrote: > > > +/* > > > + * The buffer size if strlen("4096 8192 16384 32768 65536"), > > > + * which is 28, then roun

Re: Is request_firmware() really safe to call in resume callback when /usr/lib/firmware is on btrfs?

2021-04-16 Thread Luis Chamberlain
On Thu, Apr 08, 2021 at 06:02:24PM +, Luis Chamberlain wrote: > On Sat, Apr 03, 2021 at 08:25:38PM +, Luis Chamberlain wrote: > > So creating say 1000 random files in /lib/firmware on a freshly created > > btrfs partition helps reproduce: > > > > mkfs.btrfs /dev/whatever > > mount /dev/wah

Re: [PATCH 07/42] btrfs: use u32 for length related members of btrfs_ordered_extent

2021-04-16 Thread Qu Wenruo
On 2021/4/16 下午9:54, Josef Bacik wrote: On 4/15/21 1:04 AM, Qu Wenruo wrote: Unlike btrfs_file_extent_item, btrfs_ordered_extent has its length limit (BTRFS_MAX_EXTENT_SIZE), which is far smaller than U32_MAX. Using u64 for those length related members are just a waste of memory. This patch

Re: [PATCH 08/42] btrfs: pass btrfs_inode into btrfs_writepage_endio_finish_ordered()

2021-04-16 Thread Qu Wenruo
On 2021/4/16 下午9:58, Josef Bacik wrote: On 4/15/21 1:04 AM, Qu Wenruo wrote: There is a pretty bad abuse of btrfs_writepage_endio_finish_ordered() in end_compressed_bio_write(). It passes compressed pages to btrfs_writepage_endio_finish_ordered(), which is only supposed to accept inode pages.

Re: [PATCH 09/42] btrfs: refactor how we finish ordered extent io for endio functions

2021-04-16 Thread Qu Wenruo
On 2021/4/16 下午10:09, Josef Bacik wrote: On 4/15/21 1:04 AM, Qu Wenruo wrote: Btrfs has two endio functions to mark certain io range finished for ordered extents: - __endio_write_update_ordered()    This is for direct IO - btrfs_writepage_endio_finish_ordered()    This for buffered IO. Howev

Re: [PATCH 11/42] btrfs: refactor btrfs_invalidatepage()

2021-04-16 Thread Qu Wenruo
On 2021/4/16 下午10:42, Josef Bacik wrote: On 4/15/21 1:04 AM, Qu Wenruo wrote: This patch will refactor btrfs_invalidatepage() for the incoming subpage support. The invovled modifcations are: - Use while() loop instead of "goto again;" - Use single variable to determine whether to delete exten

Re: [PATCH 14/42] btrfs: pass bytenr directly to __process_pages_contig()

2021-04-16 Thread Qu Wenruo
On 2021/4/16 下午10:58, Josef Bacik wrote: On 4/15/21 1:04 AM, Qu Wenruo wrote: As a preparation for incoming subpage support, we need bytenr passed to __process_pages_contig() directly, not the current page index. So change the parameter and all callers to pass bytenr in. With the modificatio

Re: [PATCH 17/42] btrfs: only require sector size alignment for end_bio_extent_writepage()

2021-04-16 Thread Qu Wenruo
On 2021/4/16 下午11:13, Josef Bacik wrote: On 4/15/21 1:04 AM, Qu Wenruo wrote: Just like read page, for subpage support we only require sector size alignment. So change the error message condition to only require sector alignment. This should not affect existing code, as for regular sectorsiz

Re: [PATCH 2/3] btrfs-progs: image: enlarge the output file if no tree modification is needed for restore

2021-04-16 Thread Qu Wenruo
On 2021/4/17 上午1:40, David Sterba wrote: On Fri, Mar 26, 2021 at 08:50:46PM +0800, Qu Wenruo wrote: [BUG] If restoring dumpped image into a new file, under most cases kernel will reject it: # mkfs.btrfs -f /dev/test/test # btrfs-image /dev/test/test /tmp/dump # btrfs-image -r /tmp/dump

Re: [PATCH 3/3] btrfs-progs: misc-tests: add test to ensure the restored image can be mounted

2021-04-16 Thread Qu Wenruo
On 2021/4/17 上午1:46, David Sterba wrote: On Fri, Mar 26, 2021 at 08:50:47PM +0800, Qu Wenruo wrote: This new test case is to make sure the restored image file has been properly enlarged so that newer kernel won't complain. Signed-off-by: Qu Wenruo --- .../047-image-restore-mount/test.sh

Re: [PATCH] btrfs-progs: mkfs: only output the warning if the sectorsize is not supported

2021-04-16 Thread Qu Wenruo
On 2021/4/17 上午2:14, Boris Burkov wrote: On Thu, Apr 15, 2021 at 01:30:11PM +0800, Qu Wenruo wrote: Currently mkfs.btrfs will output a warning message if the sectorsize is not the same as page size: WARNING: the filesystem may not be mountable, sectorsize 4096 doesn't match page size 6553

Re: read time tree block corruption detected

2021-04-16 Thread Qu Wenruo
On 2021/4/17 上午3:35, Gervais, Francois wrote: We are using btrfs on one of our embedded devices and we got filesystem corruption on one of them. This product undergo a lot of tests on our side and apparently it's the first it happened so it seems to be a pretty rare occurrence. However we s

Design strangeness of incremental btrfs send/recieve

2021-04-16 Thread Alexandru Stan
Hello, I have a system that btrfs sends daily its rootfs to another system far away. Incrementally (this is important to saving bandwidth since we're talking about half a TB). For a while my first system's hardware was out of commission, so I spun it up (systemd-nspawn) on the second system since

Re: Design strangeness of incremental btrfs send/recieve

2021-04-16 Thread Chris Murphy
On Fri, Apr 16, 2021 at 9:03 PM Alexandru Stan wrote: > > # sending back incrementally (eg: without sending back file-0) fails > alex@alex-desktop:/mnt% sudo btrfs send bigfs/myvolume-1 -p > bigfs/myvolume-3|sudo btrfs receive ssdfs/ > At subvol bigfs/myvolume-1 > At snapshot myvolume-

Re: Design strangeness of incremental btrfs send/recieve

2021-04-16 Thread Alexandru Stan
On Fri, 16 Apr 2021 at 20:29, Chris Murphy wrote: > > On Fri, Apr 16, 2021 at 9:03 PM Alexandru Stan wrote: > > > > # sending back incrementally (eg: without sending back file-0) fails > > alex@alex-desktop:/mnt% sudo btrfs send bigfs/myvolume-1 -p > > bigfs/myvolume-3|sudo btrfs receive ssdf

Re: Design strangeness of incremental btrfs send/recieve

2021-04-16 Thread Andrei Borzenkov
On 17.04.2021 06:29, Chris Murphy wrote: > On Fri, Apr 16, 2021 at 9:03 PM Alexandru Stan wrote: >> >> # sending back incrementally (eg: without sending back file-0) fails >> alex@alex-desktop:/mnt% sudo btrfs send bigfs/myvolume-1 -p >> bigfs/myvolume-3|sudo btrfs receive ssdfs/ >> At sub