From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f200.google.com (mail-io0-f200.google.com [209.85.223.200]) by kanga.kvack.org (Postfix) with ESMTP id 8BD076B0253 for ; Fri, 3 Jun 2016 21:10:22 -0400 (EDT) Received: by mail-io0-f200.google.com with SMTP id x85so81780162ioi.0 for ; Fri, 03 Jun 2016 18:10:22 -0700 (PDT) Received: from mail-oi0-x245.google.com (mail-oi0-x245.google.com. [2607:f8b0:4003:c06::245]) by mx.google.com with ESMTPS id p24si3328257otp.241.2016.06.03.18.10.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jun 2016 18:10:21 -0700 (PDT) Received: by mail-oi0-x245.google.com with SMTP id s139so81070412oie.0 for ; Fri, 03 Jun 2016 18:10:21 -0700 (PDT) MIME-Version: 1.0 References: <1462713387-16724-1-git-send-email-anthony.romano@coreos.com> <5739B60E.1090700@suse.cz> In-Reply-To: <5739B60E.1090700@suse.cz> From: Brandon Philips Date: Sat, 04 Jun 2016 01:10:11 +0000 Message-ID: Subject: Re: [PATCH] tmpfs: don't undo fallocate past its last page Content-Type: multipart/alternative; boundary=001a1140f2ead7dcd9053469807d Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka , Anthony Romano , hughd@google.com, Christoph Hellwig , Cong Wang , Kay Sievers , Andrew Morton , Matthew Garrett Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org --001a1140f2ead7dcd9053469807d Content-Type: text/plain; charset=UTF-8 On Mon, May 16, 2016 at 4:59 AM Vlastimil Babka wrote: > On 05/08/2016 03:16 PM, Anthony Romano wrote: > > When fallocate is interrupted it will undo a range that extends one byte > > past its range of allocated pages. This can corrupt an in-use page by > > zeroing out its first byte. Instead, undo using the inclusive byte range. > > Signed-off-by: Anthony Romano > > Looks like a stable candidate patch. Can you point out the commit that > introduced the bug, for the Fixes: tag? > Bumping this thread as I don't think this patch has gotten picked up. And cc'ing folks from 1635f6a74152f1dcd1b888231609d64875f0a81a. Thank you, Brandon > > --- > > mm/shmem.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/shmem.c b/mm/shmem.c > > index 719bd6b..f0f9405 100644 > > --- a/mm/shmem.c > > +++ b/mm/shmem.c > > @@ -2238,7 +2238,7 @@ static long shmem_fallocate(struct file *file, int > mode, loff_t offset, > > /* Remove the !PageUptodate pages we added */ > > shmem_undo_range(inode, > > (loff_t)start << PAGE_SHIFT, > > - (loff_t)index << PAGE_SHIFT, true); > > + ((loff_t)index << PAGE_SHIFT) - 1, true); > > goto undone; > > } > > > > > > --001a1140f2ead7dcd9053469807d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, May 16= , 2016 at 4:59 AM Vlastimil Babka <vba= bka@suse.cz> wrote:
On 05/08= /2016 03:16 PM, Anthony Romano wrote:
> When fallocate is interrupted it will undo a range that extends one by= te
> past its range of allocated pages. This can corrupt an in-use page by<= br> > zeroing out its first byte. Instead, undo using the inclusive byte ran= ge.
> Signed-off-by: Anthony Romano <anthony.romano@coreos.com>

Looks like a stable candidate patch. Can you point out the commit that
introduced the bug, for the Fixes: tag?

Bumping this thread as I don't think this patch has gotten picked up. = And cc'ing folks from 1635f6a74152f1dcd1b888231609d64875f0a81a.

Thank you,

Brandon
=C2=A0
> ---
>=C2=A0 =C2=A0mm/shmem.c | 2 +-
>=C2=A0 =C2=A01 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 719bd6b..f0f9405 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -2238,7 +2238,7 @@ static long shmem_fallocate(struct file *file, i= nt mode, loff_t offset,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0/* Remove the !PageUptodate pages we added */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0shmem_undo_range(inode,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(loff_t)start << PAGE_SHIFT,=
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(loff_t)index << PAGE_SHIFT, true)= ;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((loff_t)index << PAGE_SHIFT) - 1,= true);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0goto undone;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>

--001a1140f2ead7dcd9053469807d-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org