From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2E62C10F11 for ; Wed, 24 Apr 2019 13:01:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 907BA218D2 for ; Wed, 24 Apr 2019 13:01:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nexedi.com header.i=kirr@nexedi.com header.b="h3NjsLMV"; dkim=pass (1024-bit key) header.d=mandrillapp.com header.i=@mandrillapp.com header.b="h0rIGD1c" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729367AbfDXNBQ (ORCPT ); Wed, 24 Apr 2019 09:01:16 -0400 Received: from mail133-30.atl131.mandrillapp.com ([198.2.133.30]:32732 "EHLO mail133-30.atl131.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbfDXNBP (ORCPT ); Wed, 24 Apr 2019 09:01:15 -0400 X-Greylist: delayed 1801 seconds by postgrey-1.27 at vger.kernel.org; Wed, 24 Apr 2019 09:01:15 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=mandrill; d=nexedi.com; h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=kirr@nexedi.com; bh=meBFEY5ggbjVcToDIenTK6mDefScwokuA5qfAcGfUUY=; b=h3NjsLMVb6i7BR/9OCYSa6e6HJgj8Ux/hL6AKr6wAeoWN9dfBfBTi9DyALA1L3IEHTCeGkt27HNz Q6eDckv4VsmsuFOz+oxlJJeO1ipOI5P7M5joKRM2wbg8SzYNaGT2JahJ6iLaYJvumd7jPKzQb9n8 e5rlGvNaVOxqxucPECA= Received: from pmta02.mandrill.prod.atl01.rsglab.com (127.0.0.1) by mail133-30.atl131.mandrillapp.com id ho1f1m1sar8k for ; Wed, 24 Apr 2019 12:31:14 +0000 (envelope-from ) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1556109073; h=From : Subject : To : Cc : Message-Id : References : In-Reply-To : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=meBFEY5ggbjVcToDIenTK6mDefScwokuA5qfAcGfUUY=; b=h0rIGD1c0Yy5MzN/t6WZzgnL9sufF8+mYmZ/1uQcQpgDy3eFPeXn6Bidd3B958wMdApd15 AYmqmSXLgx1RUBK2zIT4drRONnBNPEbb+a1p1aFusgZ03gVH9hjZgX/gHmp6hD+uSBkuCySa 3GkrNZGfF/L4TjiDeQRpVk4rGarGU= From: Kirill Smelkov Subject: Re: [RESEND4, PATCH 1/2] fuse: retrieve: cap requested size to negotiated max_write Received: from [87.98.221.171] by mandrillapp.com id 31d5f6d6deee4221bcfa5c1ca19b72a5; Wed, 24 Apr 2019 12:31:13 +0000 To: Miklos Szeredi Cc: Miklos Szeredi , Han-Wen Nienhuys , Jakob Unterwurzacher , Kirill Tkhai , Andrew Morton , , , fuse-devel , stable Message-Id: <20190424123107.GA32024@deco.navytux.spb.ru> References: <12f7d0d98555ee0d174d04bb47644f65c07f035a.1553680185.git.kirr@nexedi.com> <20190424115620.GA2723@deco.navytux.spb.ru> In-Reply-To: X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=31050260.31d5f6d6deee4221bcfa5c1ca19b72a5 X-Mandrill-User: md_31050260 Date: Wed, 24 Apr 2019 12:31:13 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Apr 24, 2019 at 02:17:27PM +0200, Miklos Szeredi wrote: > On Wed, Apr 24, 2019 at 1:56 PM Kirill Smelkov wrote: > > > I assume you are meaning this: > > > > --- a/fs/fuse/dev.c > > +++ b/fs/fuse/dev.c > > @@ -1745,15 +1745,15 @@ static int fuse_retrieve(struct fuse_co= nn *fc, struct inode *inode, > > unsigned int offset; > > size_t total_len =3D 0; > > unsigned int num_pages; > > > > offset =3D outarg->offset & ~PAGE_MASK; > > file_size =3D i_size_read(inode); > > > > - num =3D outarg->size; > > + num =3D min(outarg->size, fc->max_write); > > if (outarg->offset > file_size) > > num =3D 0; > > else if (outarg->offset + num > file_size) > > num =3D file_size - outarg->offset; = <-- THIS > > > > num_pages =3D (num + offset + PAGE_SIZE - 1) >> PAGE_SH= IFT; > > num_pages =3D min(num_pages, fc->max_pages); > > > > and then in this case (offset + num > file_size) num overwrite > > > > num =3D file_size - offset > > > > can make num only smaller, right? And then the patch is not wrong becau= se there > > is no other num overwriting in this function except when num is being f= urther > > decremented in loop that prepares pages to retrieve. > > You're right, of course. Thanks. Does it mean that the patch is ok? Do I need to rework something? > > > Also the patch is whitespace damaged. > > > > I've tried to do the following in my mutt on "RESEND4, PATCH 1/2" > > message: > > > > |(cd ~/src/linux/linux && git am -) > > > > and the patch applied successfully. So could you please clarify what > > "whitespace damaged" means? > > Hmm, apparently this (and only this) message is "quoted-printable" > encoded. git-am seems to handle it fine, but my script doesn't. > Anyway, I'll do it manually. I see. Probably it is not "quoted-printable" as =09Content-Type: text/plain; charset=3Dutf-8 =09Content-Transfer-Encoding: 8bit suggests and it is maybe due to UTF-8 characters (I used "=C2=B7" several times in patch description). Anyway if it helps you can pull the patch from here =09https://lab.nexedi.com/kirr/linux.git=09y/fuse-retrieve-cap-max_write =09 and then cherry-pick it (git cherry-pick fd482f96537a) to where needed. Thanks again for feedback, Kirill