mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eli Billauer <eli.billauer@gmail.com>
To: mdshahid03@gmail.com
Cc: arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] char: xillybus: use stream_open for stream semantics
Date: Mon, 2 Nov 2026 12:23:02 +0100	[thread overview]
Message-ID: <24af6daf-dbf3-5c47-beb7-077c4473ea7e@outbound.gmail.com> (raw)
In-Reply-To: <20261031083610.87160-1-mdshahid03@gmail.com>

Hello Mohammad,

On 31/10/2026 9:36, mdshahid03@gmail.com wrote:
> Use stream_open() to mark these channels as streams and
> disable unnecessary file position handling,

The difference between stream_open() and nonseekable_open() is that the 
former sets FMODE_STREAM and clears FMODE_ATOMIC_POS. I made a quick 
test run, and FMODE_ATOMIC_POS isn't set in either case. As 
FMODE_ATOMIC_POS is clear, no lock is taken while updating fpos either way.

So in effect, the only difference is that FMODE_STREAM is set. Frankly 
speaking, I'm not sure in what way this matters, if at all.

> allowing read
> and write operations to run concurrently.

I checked that with hardware. There's no problem running read() and 
write() concurrently even before this patch. And I don't see why there 
would be a problem.

It seems like FMODE_STREAM was supposed to replace FMODE_ATOMIC_POS 
somewhere back in 2019 with Linus' commit 0be0ee71816b ("vfs: properly 
and reliably lock f_pos in fdget_pos()"). That is where he urged the 
move towards stream_open(). But then he reverted it with commit 
2be7d348fe92 soon afterwards.

All in all, I don't know what to say about this. Calling stream_open() 
does sound more correct, and nothing broke with this patch. But I'm 
generally unhappy fiddling with code unless it fixes something.

Regards,
    Eli

      reply	other threads:[~2026-11-02 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  8:36 mdshahid03
2026-11-02 11:23 ` Eli Billauer [this message]

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=24af6daf-dbf3-5c47-beb7-077c4473ea7e@outbound.gmail.com \
    --to=eli.billauer@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdshahid03@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

all inboxes | Powered by JetHome®