linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Bernd Schubert <bschubert@ddn.com>,
	Dharmendra Singh <dharamhans87@gmail.com>,
	linux-fsdevel@vger.kernel.org,
	fuse-devel <fuse-devel@lists.sourceforge.net>,
	linux-kernel@vger.kernel.org, Dharmendra Singh <dsingh@ddn.com>
Subject: Re: [PATCH v4 1/1] Allow non-extending parallel direct writes on the same file.
Date: Thu, 16 Jun 2022 09:17:39 -0400	[thread overview]
Message-ID: <Yqstc/0F8y+vvVMd@redhat.com> (raw)
In-Reply-To: <CAJfpegsbNPuy3YmGZ1prUyir_h_5noGZLN8R__o0=iz8n4Y9og@mail.gmail.com>

On Thu, Jun 16, 2022 at 11:01:59AM +0200, Miklos Szeredi wrote:
> On Thu, 9 Jun 2022 at 15:53, Vivek Goyal <vgoyal@redhat.com> wrote:
> 
> > Right. If user space is relying on kernel lock for thread synchronization,
> > it can not enable parallel writes.
> >
> > But if it is not relying on this, it should be able to enable parallel
> > writes. Just keep in mind that ->i_size check is not sufficient to
> > guarantee that you will not get "two extnding parallel writes". If
> > another client on a different machine truncated the file, it is
> > possible this client has old cached ->i_size and it will can
> > get multiple file extending parallel writes.
> 
> There are two cases:
> 
> 1. the filesystem can be changed only through a single fuse instance
> 
> 2. the filesystem can be changed externally.
> 
> In case 1 the fuse client must ensure that data is updated
> consistently (as defined by e.g. POSIX).  This is what I'm mostly
> worried about.
> 
> Case 2 is much more difficult in the general case, and network
> filesystems often have a relaxed consistency model.
> 
> 
> > So if fuse daemon enables parallel extending writes, it should be
> > prepared to deal with multiple extending parallel writes.
> >
> > And if this is correct assumption, I am wondering why to even try
> > to do ->i_size check and try to avoid parallel extending writes
> > in fuse kernel. May be there is something I am not aware of. And
> > that's why I am just raising questions.
> 
> We can probably do that, but it needs careful review of where i_size
> is changed and where i_size is used so we can never get into an
> inconsistent state.

Ok. Agreed that non-extending parallel writes are safer option. Atleast
for the case 1) above. For case 2) we can get multiple parallel extending
writes with these patches if another client on another machine truncates
file.

So I don't have any objections to these patches. I just wanted to
understand it better.

Thanks
Vivek


      reply	other threads:[~2022-06-16 13:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05  7:21 [PATCH v4 0/1] FUSE: Allow non-extending parallel direct writes Dharmendra Singh
2022-06-05  7:22 ` [PATCH v4 1/1] Allow non-extending parallel direct writes on the same file Dharmendra Singh
2022-06-07 21:25   ` Vivek Goyal
2022-06-07 21:42     ` Bernd Schubert
2022-06-07 22:01       ` Vivek Goyal
2022-06-07 22:42         ` Bernd Schubert
2022-06-09 13:53           ` Vivek Goyal
2022-06-10  7:24             ` Dharmendra Hans
2022-06-15 21:12               ` Vivek Goyal
2022-06-16  9:01             ` Miklos Szeredi
2022-06-16 13:17               ` Vivek Goyal [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=Yqstc/0F8y+vvVMd@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=bschubert@ddn.com \
    --cc=dharamhans87@gmail.com \
    --cc=dsingh@ddn.com \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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).