linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hao Peng <flyingpenghao@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fuse: fix possible write position calculation error
Date: Thu, 11 Nov 2021 09:40:36 +0800	[thread overview]
Message-ID: <CAPm50aJ8dA-08JdM_gwP9_bNz6iYfuK6aiih_KkgcbPKeXAuXg@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegusBqc7AsJK3+bT6Mp08UB3UN-oBn5K1yuzpgAC237DXg@mail.gmail.com>

On Wed, Nov 10, 2021 at 6:40 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Fri, 5 Nov 2021 at 08:44, Hao Peng <flyingpenghao@gmail.com> wrote:
> >
> > On Thu, Nov 4, 2021 at 8:18 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
> > >
> > > On Wed, 3 Nov 2021 at 02:15, Peng Hao <flyingpenghao@gmail.com> wrote:
> > > >
> > > > The 'written' that generic_file_direct_write return through
> > > > filemap_write_and_wait_range is not necessarily sequential,
> > > > and its iocb->ki_pos has not been updated.
> > >
> > > I don't see the bug, but maybe I'm missing something.  Can you please
> > > explain in detail?
> > >
> > I think we shouldn't add "written" to variable pos.
> > generic_file_direct_write:
> >                 ....
> >                 written = filemap_write_and_wait_range(mapping, pos,
> >                                                         pos + write_len - 1);
> >                 if (written)  //the number of writes here reflects the
> > amount of writeback data
>
> No.  It's actually an error code in this case.
>
> It is confusing, though, so I guess cleaning this up (e.g. rename
> "written" to "retval") would make sense.
>
oh,sorry.
I misunderstood. I should deeply analyze the function called below.
> Thanks,
> Miklos

  reply	other threads:[~2021-11-11  1:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03  1:15 [PATCH] fuse: fix possible write position calculation error Peng Hao
2021-11-04 12:17 ` Miklos Szeredi
2021-11-05  7:43   ` Hao Peng
2021-11-10 10:40     ` Miklos Szeredi
2021-11-11  1:40       ` Hao Peng [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-26  2:34 Peng Hao

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=CAPm50aJ8dA-08JdM_gwP9_bNz6iYfuK6aiih_KkgcbPKeXAuXg@mail.gmail.com \
    --to=flyingpenghao@gmail.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).