linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.liu@linux.alibaba.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, Miklos Szeredi <mszeredi@redhat.com>
Subject: Re: [PATCH] fuse: do not write whole page while page straddles i_size
Date: Thu, 18 Apr 2019 13:30:21 -0700	[thread overview]
Message-ID: <20190418203020.k3jgsumgqmm5b2ge@US-160370MP2.local> (raw)
In-Reply-To: <CAJfpegszKNyyjw9BV9MkLji8gPRtsqVT=pnz3cOOLv-KzkLE=A@mail.gmail.com>

On Thu, Apr 18, 2019 at 01:19:10PM +0200, Miklos Szeredi wrote:
> On Wed, Apr 17, 2019 at 10:04 PM Liu Bo <bo.liu@linux.alibaba.com> wrote:
> >
> > From: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
> >
> > If page straddles i_size and we write the whole page, the fuse
> > user-space filesystem may extend file size, it will confuse users.
> >
> > Before this patch:
> > xfs_io -t -f \
> >         -c "truncate 5120" \
> >         -c "pwrite -S 0x58 0 5120"      \
> >         -c "mmap -rw 0 5120"            \
> >         -c "mwrite -S 0x59 2048 3072" \
> >         -c "close"      \
> >         testfile
> > testfile's length will be 8192 bytes, with this patch, testfile's
> > length will be 5120 bytes.
> 
> Cannot reproduce this.  The file size should be cropped in
> fuse_flush_writepages() and the above test case produces the expected
> result, so I'm not sure how were you able to get 8192 byte file.

Hmm, this was found by fstests while testing against virtiofs 0.1
daemon code, which doesn't handle file size from fuse_in_head.  but
now with 0.2, /me couldn't reproduce it, either.

Please ignore the patch as well.

thanks,
-liubo

      reply	other threads:[~2019-04-18 20:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 20:04 [PATCH] fuse: do not write whole page while page straddles i_size Liu Bo
2019-04-18 11:19 ` Miklos Szeredi
2019-04-18 20:30   ` Liu Bo [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=20190418203020.k3jgsumgqmm5b2ge@US-160370MP2.local \
    --to=bo.liu@linux.alibaba.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mszeredi@redhat.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;
as well as URLs for NNTP newsgroup(s).