Re: file handle in statx

2023-12-12 Thread Donald Buczek
On 12/12/23 16:20, Theodore Ts'o wrote: > On Tue, Dec 12, 2023 at 10:10:23AM +0100, Donald Buczek wrote: >> On 12/12/23 06:53, Dave Chinner wrote: >> >>> So can someone please explain to me why we need to try to re-invent >>> a generic filehandle concept in statx when we already have a >>> have

Re: [PATCH v2 3/3] statx04: Skip STATX_ATTR_COMPRESSED on Bcachefs

2023-12-12 Thread Kent Overstreet
On Thu, Dec 07, 2023 at 08:40:11PM +0100, Petr Vorel wrote: > STATX_ATTR_COMPRESSED is not supported on Bcachefs, thus skip it > (it's already skipped on tmpfs and XFS). Hang on, bcachefs most definitely does hae compression. This would be just because statx isn't plumbed through? > >

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

2023-12-12 Thread Yu Kuai
Hi, 在 2023/12/12 21:14, Christoph Hellwig 写道: On Mon, Dec 11, 2023 at 05:52:17PM +0100, Jan Kara wrote: +void bdev_associated_mapping(struct block_device *bdev, +struct address_space *mapping) +{ + mapping->host = bdev->bd_inode; +} Here I'm not sure - is

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

2023-12-12 Thread Yu Kuai
Hi, 在 2023/12/12 21:16, Christoph Hellwig 写道: +void invalidate_bdev_range(struct block_device *bdev, pgoff_t start, + pgoff_t end) +{ + invalidate_mapping_pages(bdev->bd_inode->i_mapping, start, end); +} +EXPORT_SYMBOL_GPL(invalidate_bdev_range); Can we have

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

2023-12-12 Thread Kent Overstreet
On Wed, Dec 13, 2023 at 11:02:29AM +1100, NeilBrown wrote: > On Wed, 13 Dec 2023, Kent Overstreet wrote: > > On Wed, Dec 13, 2023 at 09:57:22AM +1100, NeilBrown wrote: > > > On Wed, 13 Dec 2023, Kent Overstreet wrote: > > > > On Mon, Dec 11, 2023 at 11:40:16PM +, David Howells wrote: > > > > >

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

2023-12-12 Thread NeilBrown
On Wed, 13 Dec 2023, Dave Chinner wrote: > On Wed, Dec 13, 2023 at 09:31:13AM +1100, NeilBrown wrote: > > On Wed, 13 Dec 2023, Dave Chinner wrote: > > > > > > What you are suggesting is that we now duplicate filehandle encoding > > > into every filesystem's statx() implementation. That's a bad >

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

2023-12-12 Thread NeilBrown
On Wed, 13 Dec 2023, Kent Overstreet wrote: > On Wed, Dec 13, 2023 at 09:57:22AM +1100, NeilBrown wrote: > > On Wed, 13 Dec 2023, Kent Overstreet wrote: > > > On Mon, Dec 11, 2023 at 11:40:16PM +, David Howells wrote: > > > > Kent Overstreet wrote: > > > > > > > > > I was chatting a bit with

Re: file handle in statx

2023-12-12 Thread Dave Chinner
On Tue, Dec 12, 2023 at 05:39:27PM -0500, Kent Overstreet wrote: > On Wed, Dec 13, 2023 at 09:23:18AM +1100, Dave Chinner wrote: > > On Wed, Dec 13, 2023 at 08:57:43AM +1100, NeilBrown wrote: > > > On Wed, 13 Dec 2023, Dave Chinner wrote: > > > > On Tue, Dec 12, 2023 at 09:15:29AM -0800, Frank

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

2023-12-12 Thread Kent Overstreet
On Wed, Dec 13, 2023 at 09:57:22AM +1100, NeilBrown wrote: > On Wed, 13 Dec 2023, Kent Overstreet wrote: > > On Mon, Dec 11, 2023 at 11:40:16PM +, David Howells wrote: > > > Kent Overstreet wrote: > > > > > > > I was chatting a bit with David Howells on IRC about this, and floated > > > >

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

2023-12-12 Thread Kent Overstreet
On Wed, Dec 13, 2023 at 10:06:37AM +1100, Dave Chinner wrote: > On Wed, Dec 13, 2023 at 09:31:13AM +1100, NeilBrown wrote: > > On Wed, 13 Dec 2023, Dave Chinner wrote: > > > > > > What you are suggesting is that we now duplicate filehandle encoding > > > into every filesystem's statx()

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

2023-12-12 Thread NeilBrown
On Wed, 13 Dec 2023, Kent Overstreet wrote: > On Mon, Dec 11, 2023 at 11:40:16PM +, David Howells wrote: > > 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 > > >

Re: file handle in statx

2023-12-12 Thread NeilBrown
On Wed, 13 Dec 2023, Dave Chinner wrote: > On Wed, Dec 13, 2023 at 08:57:43AM +1100, NeilBrown wrote: > > On Wed, 13 Dec 2023, Dave Chinner wrote: > > > On Tue, Dec 12, 2023 at 09:15:29AM -0800, Frank Filz wrote: > > > > > On Tue, Dec 12, 2023 at 10:10:23AM +0100, Donald Buczek wrote: > > > > > >

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

2023-12-12 Thread NeilBrown
On Wed, 13 Dec 2023, Dave Chinner wrote: > > What you are suggesting is that we now duplicate filehandle encoding > into every filesystem's statx() implementation. That's a bad > trade-off from a maintenance, testing and consistency POV because > now we end up with lots of individual, filehandle

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

2023-12-12 Thread NeilBrown
On Wed, 13 Dec 2023, Dave Chinner wrote: > On Tue, Dec 12, 2023 at 10:21:53AM -0500, Kent Overstreet wrote: > > On Tue, Dec 12, 2023 at 04:53:28PM +1100, Dave Chinner wrote: > > > Doesn't anyone else see or hear the elephant trumpeting loudly in > > > the middle of the room? > > > > > > I mean,

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

2023-12-12 Thread NeilBrown
On Wed, 13 Dec 2023, Miklos Szeredi wrote: > On Tue, 12 Dec 2023 at 17:08, Kent Overstreet > wrote: > > > In short, STATX_ATTR_INUM_NOT_UNIQUE is required to tell userspace when > > they _must_ do the new thing if they care about correctness; it provides > > a way to tell userspace what

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

2023-12-12 Thread Kent Overstreet
On Wed, Dec 13, 2023 at 07:48:16AM +1100, Dave Chinner wrote: > On Tue, Dec 12, 2023 at 10:21:53AM -0500, Kent Overstreet wrote: > > On Tue, Dec 12, 2023 at 04:53:28PM +1100, Dave Chinner wrote: > > > Doesn't anyone else see or hear the elephant trumpeting loudly in > > > the middle of the room? >

Re: file handle in statx

2023-12-12 Thread Dave Chinner
On Tue, Dec 12, 2023 at 09:15:29AM -0800, Frank Filz wrote: > > On Tue, Dec 12, 2023 at 10:10:23AM +0100, Donald Buczek wrote: > > > On 12/12/23 06:53, Dave Chinner wrote: > > > > > > > So can someone please explain to me why we need to try to re-invent > > > > a generic filehandle concept in

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

2023-12-12 Thread Dave Chinner
On Tue, Dec 12, 2023 at 10:21:53AM -0500, Kent Overstreet wrote: > On Tue, Dec 12, 2023 at 04:53:28PM +1100, Dave Chinner wrote: > > Doesn't anyone else see or hear the elephant trumpeting loudly in > > the middle of the room? > > > > I mean, we already have name_to_handle_at() for userspace to

RE: file handle in statx

2023-12-12 Thread Frank Filz
> On Tue, Dec 12, 2023 at 7:44 PM Kent Overstreet > wrote: > > > > On Tue, Dec 12, 2023 at 09:15:29AM -0800, Frank Filz wrote: > > > > On Tue, Dec 12, 2023 at 10:10:23AM +0100, Donald Buczek wrote: > > > > > On 12/12/23 06:53, Dave Chinner wrote: > > > > > > > > > > > So can someone please

Re: file handle in statx

2023-12-12 Thread Amir Goldstein
On Tue, Dec 12, 2023 at 7:44 PM Kent Overstreet wrote: > > On Tue, Dec 12, 2023 at 09:15:29AM -0800, Frank Filz wrote: > > > On Tue, Dec 12, 2023 at 10:10:23AM +0100, Donald Buczek wrote: > > > > On 12/12/23 06:53, Dave Chinner wrote: > > > > > > > > > So can someone please explain to me why we

Re: file handle in statx

2023-12-12 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 09:15:29AM -0800, Frank Filz wrote: > > On Tue, Dec 12, 2023 at 10:10:23AM +0100, Donald Buczek wrote: > > > On 12/12/23 06:53, Dave Chinner wrote: > > > > > > > So can someone please explain to me why we need to try to re-invent > > > > a generic filehandle concept in

RE: file handle in statx

2023-12-12 Thread Frank Filz
> On Tue, Dec 12, 2023 at 10:10:23AM +0100, Donald Buczek wrote: > > On 12/12/23 06:53, Dave Chinner wrote: > > > > > So can someone please explain to me why we need to try to re-invent > > > a generic filehandle concept in statx when we already have a have > > > working and widely supported user

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

2023-12-12 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 05:30:23PM +0100, Miklos Szeredi wrote: > On Tue, 12 Dec 2023 at 17:08, Kent Overstreet > wrote: > > > In short, STATX_ATTR_INUM_NOT_UNIQUE is required to tell userspace when > > they _must_ do the new thing if they care about correctness; it provides > > a way to tell

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

2023-12-12 Thread Miklos Szeredi
On Tue, 12 Dec 2023 at 17:08, Kent Overstreet wrote: > In short, STATX_ATTR_INUM_NOT_UNIQUE is required to tell userspace when > they _must_ do the new thing if they care about correctness; it provides > a way to tell userspace what guarantees we're able to provide. That flag would not help

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

2023-12-12 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 04:57:41PM +0100, Miklos Szeredi wrote: > On Tue, 12 Dec 2023 at 16:43, Kent Overstreet > wrote: > > > > On Tue, Dec 12, 2023 at 04:38:29PM +0100, Miklos Szeredi wrote: > > > On Tue, 12 Dec 2023 at 16:35, Kent Overstreet > > > wrote: > > > > > > > Other poeple have been

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

2023-12-12 Thread Miklos Szeredi
On Tue, 12 Dec 2023 at 16:43, Kent Overstreet wrote: > > On Tue, Dec 12, 2023 at 04:38:29PM +0100, Miklos Szeredi wrote: > > On Tue, 12 Dec 2023 at 16:35, Kent Overstreet > > wrote: > > > > > Other poeple have been finding ways to contribute to the technical > > > discussion; just calling

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

2023-12-12 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 04:38:29PM +0100, Miklos Szeredi wrote: > On Tue, 12 Dec 2023 at 16:35, Kent Overstreet > wrote: > > > Other poeple have been finding ways to contribute to the technical > > discussion; just calling things "ugly and broken" does not. > > Kent, calm down please. We call

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

2023-12-12 Thread Miklos Szeredi
On Tue, 12 Dec 2023 at 16:35, Kent Overstreet wrote: > Other poeple have been finding ways to contribute to the technical > discussion; just calling things "ugly and broken" does not. Kent, calm down please. We call things "ugly and broken" all the time. That's just an opinion, you are free

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

2023-12-12 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 04:29:09PM +0100, Christian Brauner wrote: > On Tue, Dec 12, 2023 at 10:16:31AM -0500, Kent Overstreet wrote: > > On Tue, Dec 12, 2023 at 09:56:45AM +0100, Christian Brauner wrote: > > > On Tue, Dec 12, 2023 at 08:32:55AM +0200, Amir Goldstein wrote: > > > > > >

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

2023-12-12 Thread Christian Brauner
On Tue, Dec 12, 2023 at 10:16:31AM -0500, Kent Overstreet wrote: > On Tue, Dec 12, 2023 at 09:56:45AM +0100, Christian Brauner wrote: > > On Tue, Dec 12, 2023 at 08:32:55AM +0200, Amir Goldstein wrote: > > > > > STATX_ATTR_INUM_NOT_UNIQUE - it is possible that two files have the > > > > >

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

2023-12-12 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 10:35:40AM +0100, Christian Brauner wrote: > On Tue, Dec 12, 2023 at 10:28:12AM +0100, Miklos Szeredi wrote: > > On Tue, 12 Dec 2023 at 10:23, Christian Brauner wrote: > > > > > > On Tue, Dec 12, 2023 at 09:10:47AM +, David Howells wrote: > > > > Christian Brauner

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

2023-12-12 Thread Christian Brauner
On Tue, Dec 12, 2023 at 03:06:07PM +0100, Miklos Szeredi wrote: > On Tue, 12 Dec 2023 at 14:48, Christian Brauner wrote: > > > Exposing the subvolume id in statx() is still fine imho. It's a concept > > shared between btrfs and bcachefs and it's pretty useful for interested > > userspace that

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

2023-12-12 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 04:53:28PM +1100, Dave Chinner wrote: > Doesn't anyone else see or hear the elephant trumpeting loudly in > the middle of the room? > > I mean, we already have name_to_handle_at() for userspace to get a > unique, opaque, filesystem defined file handle for any given file. >

Re: file handle in statx

2023-12-12 Thread Theodore Ts'o
On Tue, Dec 12, 2023 at 10:10:23AM +0100, Donald Buczek wrote: > On 12/12/23 06:53, Dave Chinner wrote: > > > So can someone please explain to me why we need to try to re-invent > > a generic filehandle concept in statx when we already have a > > have working and widely supported user API that

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

2023-12-12 Thread Kent Overstreet
On Tue, Dec 12, 2023 at 09:56:45AM +0100, Christian Brauner wrote: > On Tue, Dec 12, 2023 at 08:32:55AM +0200, Amir Goldstein wrote: > > > > STATX_ATTR_INUM_NOT_UNIQUE - it is possible that two files have the > > > > same inode number > > This is just ugly with

Re: [PATCH v2 0/3] Add support bcachefs filesystem

2023-12-12 Thread Jan Kara
On Thu 07-12-23 20:40:08, Petr Vorel wrote: > Hi all, > > @Amir @Jan, could you please have look on fanotify failures on Bcachefs? > fanotify13.c, fanotify15.c and fanotify16.c produce many errors. > > To test, just apply this patchset and then run with LTP_SINGLE_FS_TYPE: > > #

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

2023-12-12 Thread Jan Kara
On Tue 12-12-23 05:25:25, Christoph Hellwig wrote: > On Mon, Dec 11, 2023 at 10:07:53PM +0800, Yu Kuai wrote: > > +static __always_inline int buffer_uptodate_or_error(struct buffer_head *bh) > > +{ > > + /* > > +* If the buffer has the write error flag, data was failed to write > > +*

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

2023-12-12 Thread Miklos Szeredi
On Tue, 12 Dec 2023 at 14:48, Christian Brauner wrote: > Exposing the subvolume id in statx() is still fine imho. It's a concept > shared between btrfs and bcachefs and it's pretty useful for interested > userspace that wants to make use of these apis. Exposing subvolume ID should be okay, as

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

2023-12-12 Thread Christian Brauner
On Tue, Dec 12, 2023 at 10:42:58AM +0100, Miklos Szeredi wrote: > On Tue, 12 Dec 2023 at 10:35, Christian Brauner wrote: > > > So taking a step back here, please. The original motivation for this > > discussion was restricted to handle btrfs - and now bcachefs as well. > > Both have a concept of

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

2023-12-12 Thread Christoph Hellwig
On Mon, Dec 11, 2023 at 10:07:53PM +0800, Yu Kuai wrote: > +static __always_inline int buffer_uptodate_or_error(struct buffer_head *bh) > +{ > + /* > + * If the buffer has the write error flag, data was failed to write > + * out in the block. In this case, set buffer uptodate to

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

2023-12-12 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

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

2023-12-12 Thread Christoph Hellwig
> +void invalidate_bdev_range(struct block_device *bdev, pgoff_t start, > +pgoff_t end) > +{ > + invalidate_mapping_pages(bdev->bd_inode->i_mapping, start, end); > +} > +EXPORT_SYMBOL_GPL(invalidate_bdev_range); Can we have kerneldoc comments for the new helpers

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

2023-12-12 Thread Christoph Hellwig
On Mon, Dec 11, 2023 at 05:52:17PM +0100, Jan Kara wrote: > > +void bdev_associated_mapping(struct block_device *bdev, > > +struct address_space *mapping) > > +{ > > + mapping->host = bdev->bd_inode; > > +} > > Here I'm not sure - is the helper really a win? It seems a

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

2023-12-12 Thread David Howells
Christian Brauner wrote: > > There is a upcoming potential problem where even the 64-bit field I placed > > in statx() may be insufficient. The Auristor AFS server, for example, has > > a 96-bit vnode ID, but I can't properly represent this in stx_ino. > > Currently, I > > Is that vnode ID

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

2023-12-12 Thread Miklos Szeredi
On Tue, 12 Dec 2023 at 10:35, Christian Brauner wrote: > So taking a step back here, please. The original motivation for this > discussion was restricted to handle btrfs - and now bcachefs as well. > Both have a concept of a subvolume so it made sense to go that route. > IOW, it wasn't

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

2023-12-12 Thread Christian Brauner
On Tue, Dec 12, 2023 at 10:28:12AM +0100, Miklos Szeredi wrote: > On Tue, 12 Dec 2023 at 10:23, Christian Brauner wrote: > > > > On Tue, Dec 12, 2023 at 09:10:47AM +, David Howells wrote: > > > Christian Brauner wrote: > > > > > > > > > > I suggest: > > > > > > > > > > > > > >

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

2023-12-12 Thread Miklos Szeredi
On Tue, 12 Dec 2023 at 10:23, Christian Brauner wrote: > > On Tue, Dec 12, 2023 at 09:10:47AM +, David Howells wrote: > > Christian Brauner wrote: > > > > > > > > I suggest: > > > > > > > > > > > > STATX_ATTR_INUM_NOT_UNIQUE - it is possible that two files have the > > > > > >

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

2023-12-12 Thread Christian Brauner
On Tue, Dec 12, 2023 at 09:10:47AM +, David Howells wrote: > Christian Brauner wrote: > > > > > > I suggest: > > > > > > > > > > STATX_ATTR_INUM_NOT_UNIQUE - it is possible that two files have the > > > > > same inode number > > > > This is just ugly with

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

2023-12-12 Thread David Howells
Christian Brauner wrote: > > > > I suggest: > > > > > > > > STATX_ATTR_INUM_NOT_UNIQUE - it is possible that two files have the > > > > same inode number > > This is just ugly with questionable value. A constant reminder of how > broken this is. Exposing the

Re: file handle in statx

2023-12-12 Thread Donald Buczek
On 12/12/23 06:53, Dave Chinner wrote: > So can someone please explain to me why we need to try to re-invent > a generic filehandle concept in statx when we already have a > have working and widely supported user API that provides exactly > this functionality? name_to_handle_at() is fine, but

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

2023-12-12 Thread Christian Brauner
On Tue, Dec 12, 2023 at 01:13:07PM +1100, NeilBrown wrote: > 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... > > > >

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

2023-12-12 Thread Christian Brauner
On Tue, Dec 12, 2023 at 08:32:55AM +0200, Amir Goldstein wrote: > 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