Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread David Howells
Dave Chinner wrote: > I mean, we already have name_to_handle_at() for userspace to get a > unique, opaque, filesystem defined file handle for any given file. > It's the same filehandle that filesystems hand to the nfsd so nfs > clients can uniquely identify the file they are asking the nfsd to >

Re: [PATCH RFC v2 for-6.8/block 11/18] erofs: use bdev api

2023-12-11 Thread Yu Kuai
Hi, 在 2023/12/12 14:35, Gao Xiang 写道: On 2023/12/11 22:07, Yu Kuai wrote: From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai ---   fs/erofs/data.c | 18 --   fs/erofs/internal.h |  2 ++   2 files

Re: [PATCH RFC v2 for-6.8/block 11/18] erofs: use bdev api

2023-12-11 Thread Gao Xiang
On 2023/12/11 22:07, Yu Kuai wrote: From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- fs/erofs/data.c | 18 -- fs/erofs/internal.h | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-)

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread Amir Goldstein
On Tue, Dec 12, 2023 at 7:53 AM Dave Chinner wrote: > > On Tue, Dec 12, 2023 at 11:59:51AM +1100, NeilBrown wrote: > > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > > On Tue, Dec 12, 2023 at 10:53:07AM +1100, NeilBrown wrote: > > > > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > > > > On Tue,

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread Dave Chinner
On Tue, Dec 12, 2023 at 11:59:51AM +1100, NeilBrown wrote: > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > On Tue, Dec 12, 2023 at 10:53:07AM +1100, NeilBrown wrote: > > > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > > > On Tue, Dec 12, 2023 at 09:43:27AM +1100, NeilBrown wrote: > > > > > On

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 01:13:07PM +1100, NeilBrown wrote: > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > I suppose if we want to be able to round trip this stuff we do need to > > allocate space for it, even if a local filesystem would never include > > it. > > > > > I suggest: > > > > > >

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread NeilBrown
On Tue, 12 Dec 2023, Kent Overstreet wrote: > On Tue, Dec 12, 2023 at 11:59:51AM +1100, NeilBrown wrote: > > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > > NFSv4 specs that for the maximum size? That is pretty hefty... > > > > It is - but it needs room to identify the filesystem and it needs

Re: [PATCH RFC v2 for-6.8/block 15/18] buffer: add a new helper to read sb block

2023-12-11 Thread Yu Kuai
Hi, 在 2023/12/12 1:27, Jan Kara 写道: On Mon 11-12-23 22:07:53, Yu Kuai wrote: From: Yu Kuai Unlike __bread_gfp(), ext4 has special handing while reading sb block: 1) __GFP_NOFAIL is not set, and memory allocation can fail; 2) If buffer write failed before, set buffer uptodate and don't read

Re: [PATCH RFC v2 for-6.8/block 01/18] block: add some bdev apis

2023-12-11 Thread Yu Kuai
Hi, 在 2023/12/12 0:52, Jan Kara 写道: On Mon 11-12-23 22:05:35, Yu Kuai wrote: From: Yu Kuai Those apis will be used for other modules, so that bd_inode won't be accessed directly from other modules. Signed-off-by: Yu Kuai ... +void bdev_associated_mapping(struct block_device *bdev, +

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 11:59:51AM +1100, NeilBrown wrote: > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > NFSv4 specs that for the maximum size? That is pretty hefty... > > It is - but it needs room to identify the filesystem and it needs to be > stable across time. That need is more than a

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread NeilBrown
On Tue, 12 Dec 2023, Kent Overstreet wrote: > On Tue, Dec 12, 2023 at 10:53:07AM +1100, NeilBrown wrote: > > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > > On Tue, Dec 12, 2023 at 09:43:27AM +1100, NeilBrown wrote: > > > > On Sat, 09 Dec 2023, Kent Overstreet wrote: > > > > > On Fri, Dec 08,

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread David Howells
NeilBrown wrote: > I'm not in favour of any filesystem depending on this for correct > functionality today. As long as the filesystem isn't so large that > inum+volnum simply cannot fit in 64 bits, we should make a reasonable > effort to present them both in 64 bits. The Auristor version of

Re: [GIT PULL] More bcachefs fixes for 6.7

2023-12-11 Thread pr-tracker-bot
The pull request you sent on Sun, 10 Dec 2023 18:57:18 -0500: > https://evilpiepirate.org/git/bcachefs.git tags/bcachefs-2023-12-10 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/26aff849438cebcd05f1a647390c4aa700d5c0f1 Thank you! -- Deet-doot-dot, I am a bot.

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 10:53:07AM +1100, NeilBrown wrote: > On Tue, 12 Dec 2023, Kent Overstreet wrote: > > On Tue, Dec 12, 2023 at 09:43:27AM +1100, NeilBrown wrote: > > > On Sat, 09 Dec 2023, Kent Overstreet wrote: > > > > On Fri, Dec 08, 2023 at 12:34:28PM +0100, Donald Buczek wrote: > > > > >

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread NeilBrown
On Tue, 12 Dec 2023, Kent Overstreet wrote: > On Tue, Dec 12, 2023 at 09:43:27AM +1100, NeilBrown wrote: > > On Sat, 09 Dec 2023, Kent Overstreet wrote: > > > On Fri, Dec 08, 2023 at 12:34:28PM +0100, Donald Buczek wrote: > > > > On 12/8/23 03:49, Kent Overstreet wrote: > > > > > > > > > We

Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread David Howells
Kent Overstreet wrote: > I was chatting a bit with David Howells on IRC about this, and floated > adding the file handle to statx. It looks like there's enough space > reserved to make this feasible - probably going with a fixed maximum > size of 128-256 bits. We can always save the last bit to

file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)

2023-12-11 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 09:43:27AM +1100, NeilBrown wrote: > On Sat, 09 Dec 2023, Kent Overstreet wrote: > > On Fri, Dec 08, 2023 at 12:34:28PM +0100, Donald Buczek wrote: > > > On 12/8/23 03:49, Kent Overstreet wrote: > > > > > > > We really only need 6 or 7 bits out of the inode number for

Re: How to cope with subvolumes and snapshots on muti-user systems?

2023-12-11 Thread NeilBrown
On Sat, 09 Dec 2023, Kent Overstreet wrote: > On Fri, Dec 08, 2023 at 12:34:28PM +0100, Donald Buczek wrote: > > On 12/8/23 03:49, Kent Overstreet wrote: > > > > > We really only need 6 or 7 bits out of the inode number for sharding; > > > then 20-32 bits (nobody's going to have a billion

Re: [PATCH RFC v2 for-6.8/block 15/18] buffer: add a new helper to read sb block

2023-12-11 Thread Jan Kara
On Mon 11-12-23 22:07:53, Yu Kuai wrote: > From: Yu Kuai > > Unlike __bread_gfp(), ext4 has special handing while reading sb block: > > 1) __GFP_NOFAIL is not set, and memory allocation can fail; > 2) If buffer write failed before, set buffer uptodate and don't read >block from disk; > 3)

Re: [PATCH RFC v2 for-6.8/block 16/18] ext4: use new helper to read sb block

2023-12-11 Thread Jan Kara
On Mon 11-12-23 22:08:08, Yu Kuai wrote: > From: Yu Kuai > > Remove __ext4_sb_bread_gfp() and ext4_buffer_uptodate() that is defined > by ext4, and convert to use common helper __bread_gfp2() and > buffer_uptodate_or_error(). > > Signed-off-by: Yu Kuai Looks good. Feel free to add:

Re: [PATCH RFC v2 for-6.8/block 17/18] ext4: remove block_device_ejected()

2023-12-11 Thread Jan Kara
On Mon 11-12-23 22:08:33, Yu Kuai wrote: > From: Yu Kuai > > block_device_ejected() is added by commit bdfe0cbd746a ("Revert > "ext4: remove block_device_ejected"") in 2015. At that time 'bdi->wb' > is destroyed synchronized from del_gendisk(), hence if ext4 is still > mounted, and then

Re: [PATCH RFC v2 for-6.8/block 18/18] ext4: use bdev apis

2023-12-11 Thread Jan Kara
On Mon 11-12-23 22:08:39, Yu Kuai wrote: > From: Yu Kuai > > Avoid to access bd_inode directly, prepare to remove bd_inode from > block_devcie. ^^^ device > Signed-off-by: Yu Kuai Looks good. Feel free to add: Reviewed-by: Jan Kara

Re: [PATCH RFC v2 for-6.8/block 01/18] block: add some bdev apis

2023-12-11 Thread Jan Kara
On Mon 11-12-23 22:05:35, Yu Kuai wrote: > From: Yu Kuai > > Those apis will be used for other modules, so that bd_inode won't be > accessed directly from other modules. > > Signed-off-by: Yu Kuai ... > +void bdev_associated_mapping(struct block_device *bdev, > +

[PATCH RFC v2 for-6.8/block 18/18] ext4: use bdev apis

2023-12-11 Thread Yu Kuai
From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- fs/ext4/dir.c | 6 ++ fs/ext4/ext4_jbd2.c | 6 +++--- fs/ext4/super.c | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/fs/ext4/dir.c

[PATCH RFC v2 for-6.8/block 17/18] ext4: remove block_device_ejected()

2023-12-11 Thread Yu Kuai
From: Yu Kuai block_device_ejected() is added by commit bdfe0cbd746a ("Revert "ext4: remove block_device_ejected"") in 2015. At that time 'bdi->wb' is destroyed synchronized from del_gendisk(), hence if ext4 is still mounted, and then mark_buffer_dirty() will reference destroyed 'wb'. However,

[PATCH RFC v2 for-6.8/block 16/18] ext4: use new helper to read sb block

2023-12-11 Thread Yu Kuai
From: Yu Kuai Remove __ext4_sb_bread_gfp() and ext4_buffer_uptodate() that is defined by ext4, and convert to use common helper __bread_gfp2() and buffer_uptodate_or_error(). Signed-off-by: Yu Kuai --- fs/ext4/ext4.h| 13 - fs/ext4/inode.c | 8 fs/ext4/super.c |

[PATCH RFC v2 for-6.8/block 15/18] buffer: add a new helper to read sb block

2023-12-11 Thread Yu Kuai
From: Yu Kuai Unlike __bread_gfp(), ext4 has special handing while reading sb block: 1) __GFP_NOFAIL is not set, and memory allocation can fail; 2) If buffer write failed before, set buffer uptodate and don't read block from disk; 3) REQ_META is set for all IO, and REQ_PRIO is set for

[PATCH RFC v2 for-6.8/block 14/18] jbd2: use bdev apis

2023-12-11 Thread Yu Kuai
From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- fs/jbd2/journal.c | 3 +-- fs/jbd2/recovery.c | 6 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index

[PATCH RFC v2 for-6.8/block 13/18] nilfs2: use bdev api in nilfs_attach_log_writer()

2023-12-11 Thread Yu Kuai
From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- fs/nilfs2/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 55e31cc903d1..a1130e384937 100644

[PATCH RFC v2 for-6.8/block 12/18] gfs2: use bdev api

2023-12-11 Thread Yu Kuai
From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- fs/gfs2/glock.c | 2 +- fs/gfs2/ops_fstype.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index

[PATCH RFC v2 for-6.8/block 11/18] erofs: use bdev api

2023-12-11 Thread Yu Kuai
From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- fs/erofs/data.c | 18 -- fs/erofs/internal.h | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/fs/erofs/data.c b/fs/erofs/data.c

[PATCH RFC v2 for-6.8/block 10/18] cramfs: use bdev apis in cramfs_blkdev_read()

2023-12-11 Thread Yu Kuai
From: Yu Kuai On the one hand covert to use folio while reading bdev inode, on the other hand prevent to access bd_inode directly. Also do some cleanup that there is no need for two for loop, and remove local array pages. Signed-off-by: Yu Kuai --- fs/cramfs/inode.c | 36

[PATCH RFC v2 for-6.8/block 09/18] btrfs: use bdev apis

2023-12-11 Thread Yu Kuai
From: Yu Kuai On the one hand covert to use folio while reading bdev inode, on the other hand prevent to access bd_inode directly. Signed-off-by: Yu Kuai --- fs/btrfs/disk-io.c | 71 +- fs/btrfs/volumes.c | 17 ++- fs/btrfs/zoned.c | 15

[PATCH RFC v2 for-6.8/block 08/18] bio: export bio_add_folio_nofail()

2023-12-11 Thread Yu Kuai
From: Yu Kuai Currently btrfs is using __bio_add_page() in write_dev_supers(). In order to convert to use folio for bdev in btrfs, export bio_add_folio_nofail() so that it can replace __bio_add_page(). Signed-off-by: Yu Kuai --- block/bio.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH RFC v2 for-6.8/block 07/18] bcachefs: remove dead function bdev_sectors()

2023-12-11 Thread Yu Kuai
From: Yu Kuai bdev_sectors() is not used hence remove it. Signed-off-by: Yu Kuai --- fs/bcachefs/util.h | 5 - 1 file changed, 5 deletions(-) diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index 2984b57b2958..22a0acc1704f 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@

[PATCH RFC v2 for-6.8/block 06/18] scsicam: use bdev api in scsi_bios_ptable()

2023-12-11 Thread Yu Kuai
From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- drivers/scsi/scsicam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c index

[PATCH RFC v2 for-6.8/block 05/18] s390/dasd: use bdev api in dasd_format()

2023-12-11 Thread Yu Kuai
From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- drivers/s390/block/dasd_ioctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c

[PATCH RFC v2 for-6.8/block 04/18] mtd: block2mtd: use bdev apis

2023-12-11 Thread Yu Kuai
From: Yu Kuai On the one hand covert to use folio while reading bdev inode, on the other hand prevent to access bd_inode directly. Signed-off-by: Yu Kuai --- drivers/mtd/devices/block2mtd.c | 81 +++-- 1 file changed, 36 insertions(+), 45 deletions(-) diff --git

[PATCH RFC v2 for-6.8/block 03/18] bcache: use bdev api in read_super()

2023-12-11 Thread Yu Kuai
From: Yu Kuai On the one hand covert to use folio while reading bdev inode, on the other hand prevent to access bd_inode directly. Signed-off-by: Yu Kuai --- drivers/md/bcache/super.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/md/bcache/super.c

[PATCH RFC v2 for-6.8/block 01/18] block: add some bdev apis

2023-12-11 Thread Yu Kuai
From: Yu Kuai Those apis will be used for other modules, so that bd_inode won't be accessed directly from other modules. Signed-off-by: Yu Kuai --- block/bdev.c | 70 ++ block/blk.h| 2 -- include/linux/blkdev.h | 17 ++ 3

[PATCH RFC v2 for-6.8/block 02/18] xen/blkback: use bdev api in xen_update_blkif_status()

2023-12-11 Thread Yu Kuai
From: Yu Kuai Avoid to access bd_inode directly, prepare to remove bd_inode from block_devcie. Signed-off-by: Yu Kuai --- drivers/block/xen-blkback/xenbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/xen-blkback/xenbus.c

[PATCH RFC v2 for-6.8/block 00/18] block: don't access bd_inode directly from other modules

2023-12-11 Thread Yu Kuai
From: Yu Kuai Changes in v2: - remove some bdev apis that is not necessary; - pass in offset for bdev_read_folio() and __bdev_get_folio(); - remove bdev_gfp_constraint() and add a new helper in fs/buffer.c to prevent access bd_indoe() directly from mapping_gfp_constraint() in ext4.(patch