Linux block layer
 help / color / mirror / Atom feed
From: Kanchan Joshi <joshi.k@samsung.com>
To: Christoph Hellwig <hch@lst.de>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	brauner@kernel.org, dgc@kernel.org, jack@suse.cz, cem@kernel.org,
	axboe@kernel.dk, kbusch@kernel.org, ritesh.list@gmail.com,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-block@vger.kernel.org, gost.dev@samsung.com,
	Anuj Gupta <anuj20.g@samsung.com>
Subject: Re: [PATCH v4 1/6] fs: add write-stream management ioctls
Date: Wed, 26 Aug 2026 16:12:52 +0530	[thread overview]
Message-ID: <c6064b06-9e34-4790-80ef-c76333c2a11a@samsung.com> (raw)
In-Reply-To: <20260825065533.GA24808@lst.de>

On 8/25/2026 12:25 PM, Christoph Hellwig wrote:
> On Mon, Aug 24, 2026 at 12:00:46PM +0530, Kanchan Joshi wrote:
>>>> - That stream/fd will be unavailable if some other application has
>>>> already opened it.
>>>> - If applications gets the stream fd, it can use that to set stream id
>>>> for multiple files.
>>>> - It can close the stream-fd and that does not change anything for the
>>>> file resource (i.e, its inode continue to carry the stream-id value that
>>>> was set).
>>>>
>>>> Christoph - does this match?
>>>
>>> Almost.  I didn't really think of your last point there.  If the
>>> inodes keeps using it when it is dropped that breaks the model a
>>> bit, but revoking it might make things a bit ugly and slow.  Urgg.
>>
>> I think it is consistent to the model that says stream fd is a distinct
>> resource and it is a necessary lease/license to set the particular
>> stream(-id) across files.
>> If the stream-fd is held, that stream-id remains exclusive to the
>> application.
>> Closing means, applications is fine to release the license and
>> underlying stream-id becomes available to other users.
> 
> But that also means it can be reallocated to other users, which
> now mix data.  I guess the answer might be "don't do this", but
> I'd love to have interfaces that aren't easy to abuse.  OTOH
> implementing this might be quite an overhead.
> 
>>>> 4. FS_IOC_QUERY_FILE_WRITE_STREAM_ID		_IOR('f', 138, __u32)
>>>>
>>>> Queries the write-stream value (__u32) currently assigned to the file
>>>> (its inode).
>>>
>>> I'm not sure exposing the actual ID to the user space application is a
>>> that good idea,
>>
>> But don't we need a way to know if stream id/value is set on a file or
>> not? This ioctl is more about observability; GET equivalent of SET.
>> Also write stream value is not going to be there if/when in-core inode
>> gets evicted.
> 
> Yes, but the application needs to basically set it after open
> anyway.  Keeping any kind of state over a file descriptor that
> has been closed doesn't make much sense.
> 
>>> same for passing in the wanted ID when allocating.
>>
>> Can drop OPEN_EXACT flag if you prefer that.
>> But this was for the case if application restarted and wanted its new
>> data to go into the bucket where it was previously writing.
> 
> But that assumes that the bucket hasn't otherwise been reused, which
> might not be the case.
> 
>>> That leaks a lot of internal details.
>>
>> I viewed stream-id similar to how we view file-name. Application can
>> list file names, but need the fd to do operations on that file.
>> So, I could not understand internal details part. Could you explain? We
>> have FIEMAP and unprivileged XFS_IOC_FSGEOMETRY already expose the
>> placement of the file.
> 
> There are a lot of operations on filenames.. XFS_IOC_FSGEOMETRY and
> are in a different register than normal file operations.  If we
> want to expose the mapped stream IDs I'd also rather have them in
> a different register than the usual APIs.
> 

So based on the above discussion, do you see this as the right interface?

1. FS_IOC_WRITE_STREAM_GET_MAX : query max write streams
2. FS_IOC_WRITE_STREAM_ALLOC: allocate any write stream (if available) 
and return stream fd. No flag whatsoever.
3. FS_IOC_WRITE_STREAM_SET: set write stream into a file using stream-fd

  reply	other threads:[~2026-08-26 10:42 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260717125624epcas5p3fefc5b8ff274260bf8fb2f1b225b4f9a@epcas5p3.samsung.com>
2026-07-17 12:55 ` [PATCH v4 0/6] xfs write streams Kanchan Joshi
2026-07-17 12:55   ` [PATCH v4 1/6] fs: add write-stream management ioctls Kanchan Joshi
2026-07-21  3:03     ` Darrick J. Wong
2026-07-30 14:52       ` Kanchan Joshi
2026-07-30 17:22         ` Darrick J. Wong
2026-07-31  8:15           ` Kanchan Joshi
2026-08-19  7:04           ` Christoph Hellwig
2026-08-19 22:05             ` Darrick J. Wong
2026-08-20  5:15             ` Miklos Szeredi
2026-08-19  7:08         ` Christoph Hellwig
2026-08-24  6:30           ` Kanchan Joshi
2026-08-25  6:55             ` Christoph Hellwig
2026-08-26 10:42               ` Kanchan Joshi [this message]
2026-08-19  7:11     ` Christoph Hellwig
2026-07-17 12:55   ` [PATCH v4 2/6] iomap: introduce and propagate write_stream Kanchan Joshi
2026-08-19  7:09     ` Christoph Hellwig
2026-07-17 12:55   ` [PATCH v4 3/6] xfs: implement write-stream management support Kanchan Joshi
2026-07-21  3:08     ` Darrick J. Wong
2026-07-31  8:03       ` Kanchan Joshi
2026-08-19  7:12         ` Christoph Hellwig
2026-08-19  7:18     ` Christoph Hellwig
2026-08-19  7:24     ` Christoph Hellwig
2026-08-21 11:39       ` Kanchan Joshi
2026-07-17 12:55   ` [PATCH v4 4/6] xfs: generic AG set based steering Kanchan Joshi
2026-07-21  3:20     ` Darrick J. Wong
2026-07-24 14:57       ` Kanchan Joshi
2026-08-19  7:21     ` Christoph Hellwig
2026-08-21 12:08       ` Kanchan Joshi
2026-07-17 12:55   ` [PATCH v4 5/6] xfs: write stream based AG placement Kanchan Joshi
2026-08-19  7:29     ` Christoph Hellwig
2026-08-21 12:33       ` Kanchan Joshi
2026-08-25  6:57         ` Christoph Hellwig
2026-07-17 12:55   ` [PATCH v4 6/6] xfs: introduce software write streams Kanchan Joshi
2026-08-19  7:31     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6064b06-9e34-4790-80ef-c76333c2a11a@samsung.com \
    --to=joshi.k@samsung.com \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=dgc@kernel.org \
    --cc=djwong@kernel.org \
    --cc=gost.dev@samsung.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox