From: Bernd Schubert <bernd.schubert@fastmail.fm>
To: Jingbo Xu <jefflexu@linux.alibaba.com>,
Bernd Schubert <bschubert@ddn.com>,
miklos@szeredi.hu
Cc: linux-fsdevel@vger.kernel.org, dsingh@ddn.com,
Amir Goldstein <amir73il@gmail.com>
Subject: Re: [PATCH v2 2/5] fuse: Create helper function if DIO write needs exclusive lock
Date: Wed, 7 Feb 2024 14:38:12 +0100 [thread overview]
Message-ID: <b9308f8b-cda3-486f-be23-6e84cc0c8b6d@fastmail.fm> (raw)
In-Reply-To: <2d0d6581-14de-46c4-a664-f6e193ab2518@linux.alibaba.com>
On 2/6/24 10:20, Jingbo Xu wrote:
>
>
> On 2/1/24 7:08 AM, Bernd Schubert wrote:
>> @@ -1591,10 +1616,10 @@ static ssize_t fuse_direct_write_iter(struct kiocb *iocb, struct iov_iter *from)
>> else {
>> inode_lock_shared(inode);
>>
>> - /* A race with truncate might have come up as the decision for
>> - * the lock type was done without holding the lock, check again.
>> + /*
>> + * Previous check was without any lock and might have raced.
>> */
>> - if (fuse_direct_write_extending_i_size(iocb, from)) {
>> + if (fuse_dio_wr_exclusive_lock(iocb, from)) {
> ^
>
> The overall is good. Maybe fuse_io_past_eof() is better to make it a
> solely cleanup or refactoring. Actually it's already changed back to
> fuse_io_past_eof() in patch 3/5.
So I'm bit confused what you would like to see improved. Patch 2/5
renames "fuse_direct_write_extending_i_size" to "fuse_io_past_eof" and
also moves it up in the file. (The latter is a preparation for my
direct-write consolidation patches.). It also creates the helper
function fuse_dio_wr_exclusive_lock(). None of that is changed in 3/5,
which just moves the locking/unlocking from fuse_cache_write_iter() into
the functions fuse_dio_lock/fuse_dio_unlock.
Thanks,
Bernd
next prev parent reply other threads:[~2024-02-07 13:38 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 23:08 [PATCH v2 0/5] fuse: inode IO modes and mmap Bernd Schubert
2024-01-31 23:08 ` [PATCH v2 1/5] fuse: Fix VM_MAYSHARE and direct_io_allow_mmap Bernd Schubert
2024-02-01 8:45 ` Miklos Szeredi
2024-02-01 14:36 ` Bernd Schubert
2024-02-01 14:52 ` Miklos Szeredi
2024-02-01 15:39 ` Bernd Schubert
2024-02-01 15:43 ` Miklos Szeredi
2024-02-01 15:48 ` Amir Goldstein
2024-02-01 16:16 ` Bernd Schubert
2024-02-02 14:47 ` Bernd Schubert
2024-01-31 23:08 ` [PATCH v2 2/5] fuse: Create helper function if DIO write needs exclusive lock Bernd Schubert
2024-02-06 9:20 ` Jingbo Xu
2024-02-07 13:38 ` Bernd Schubert [this message]
2024-02-07 13:44 ` Jingbo Xu
2024-02-07 14:13 ` Bernd Schubert
2024-02-08 0:04 ` Jingbo Xu
2024-01-31 23:08 ` [PATCH v2 3/5] fuse: Add fuse_dio_lock/unlock helper functions Bernd Schubert
2024-01-31 23:08 ` [PATCH v2 4/5] fuse: prepare for failing open response Bernd Schubert
2024-02-01 9:23 ` Miklos Szeredi
2024-02-01 10:16 ` Amir Goldstein
2024-02-01 10:28 ` Miklos Szeredi
2024-02-01 10:41 ` Amir Goldstein
2024-02-01 10:51 ` Miklos Szeredi
2024-02-01 16:46 ` Amir Goldstein
2024-02-02 12:03 ` Amir Goldstein
2024-02-02 15:49 ` Miklos Szeredi
2024-02-02 15:55 ` Miklos Szeredi
2024-02-02 16:07 ` Amir Goldstein
2024-01-31 23:08 ` [PATCH v2 5/5] fuse: introduce inode io modes Bernd Schubert
2024-02-01 14:47 ` Miklos Szeredi
2024-02-01 16:33 ` Amir Goldstein
2024-02-01 17:53 ` Bernd Schubert
2024-02-02 19:40 ` Amir Goldstein
2024-02-06 12:39 ` Amir Goldstein
2024-02-06 12:53 ` Miklos Szeredi
2024-02-06 13:07 ` Amir Goldstein
2024-02-01 10:30 ` [PATCH v2 0/5] fuse: inode IO modes and mmap Amir Goldstein
2024-02-01 14:30 ` Bernd Schubert
2024-02-01 15:56 ` Amir Goldstein
2024-02-01 16:01 ` Bernd Schubert
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=b9308f8b-cda3-486f-be23-6e84cc0c8b6d@fastmail.fm \
--to=bernd.schubert@fastmail.fm \
--cc=amir73il@gmail.com \
--cc=bschubert@ddn.com \
--cc=dsingh@ddn.com \
--cc=jefflexu@linux.alibaba.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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;
as well as URLs for NNTP newsgroup(s).