Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2332513ybl; Sun, 18 Aug 2019 23:53:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpM1y0ObOCcs8DIZjEbHaDzqZCG7d6xWfvjcEfHmAdTVh1S7l0hpDiEkVQk/P67xLm007E X-Received: by 2002:a17:902:684f:: with SMTP id f15mr21283485pln.332.1566197633825; Sun, 18 Aug 2019 23:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566197633; cv=none; d=google.com; s=arc-20160816; b=hiLyXcpEFI2irQxDfuIy7X8u2R7UnCf4NzXFMrKRTlJK+80SeOtiq4w32blybed2AA jjvAVxD5abC6SzZdT0K17EpEiyX8BSb6ZjwPX8pWX54e6zLH/n2XEyANHbBGnwSCw6Fb 7U7/QSBkSwKRary9KqPepiz8xO1Q4weYkd3tfrRKKIqbIaa41i7fEH9b/oVlb4qUOEse TSXcCvMsvyaxYLl6/PI4kxUT0itQ9dLFH5BV2FQkdNNwfiuA/VXeMze23lnw+JDWY4pt 8RI98e2mGDZroGppCyBQ+mKMmVhqNci6cdpuTgKRU9cgkSfWlKK3z0n0XuwM+OZ79FWk fchg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=BSdQrbpSL9xjVA+ELdRNBBAwdtLx+IXjV/cMNewXntw=; b=ssoGZmOPk1azaw+qmYDpFSIQw/jnilHgBwRcE+wv7CfFV8ik56SfsfOfGNaqKREiUr MF+OmNUO1hY1hCHP6z93GByHZZY9482RPJiJBkBaBB7PrLaQc735V9Vmfgrd0blbfeu8 k8SuVlwHhmanD1K0ghLphW276CeJhFYcyaeJ+nNUqBkeIQZGMVpLR9QYMEHZVkieH4C9 sczLzs/NuvdiiiOuyMde4XXjOnCwZ8P86K6LAwzeUPJuKJT9CIZ6JpJDeu3SAuUr0otu s/H1AUtPprDODMqN7gTiOdBx+bKSK7URvRA5FZqi9LDPq/oWVQovmqQmyd6HSLb0V9GN HoLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si9210647pgu.549.2019.08.18.23.53.38; Sun, 18 Aug 2019 23:53:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbfHSGww (ORCPT + 99 others); Mon, 19 Aug 2019 02:52:52 -0400 Received: from relay.sw.ru ([185.231.240.75]:45078 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbfHSGww (ORCPT ); Mon, 19 Aug 2019 02:52:52 -0400 Received: from [172.16.24.21] by relay.sw.ru with esmtp (Exim 4.92) (envelope-from ) id 1hzbX6-0008In-Ez; Mon, 19 Aug 2019 09:52:48 +0300 Subject: Re: [PATCH] fuse: BUG_ON's correction in fuse_dev_splice_write() To: Miklos Szeredi Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrey Ryabinin References: From: Vasily Averin Message-ID: <5cb431ed-5fba-0223-2d4f-64efd36c1c24@virtuozzo.com> Date: Mon, 19 Aug 2019 09:52:47 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/1/19 2:01 PM, Miklos Szeredi wrote: > On Tue, Jul 23, 2019 at 8:33 AM Vasily Averin wrote: >> >> commit 963545357202 ("fuse: reduce allocation size for splice_write") >> changed size of bufs array, so first BUG_ON should be corrected too. >> Second BUG_ON become useless, first one also includes the second check: >> any unsigned nbuf value cannot be less than 0. > > This patch seems broken: it assumes that pipe->nrbufs doesn't change. > Have you actually tested it? You're right, I've missed it. I've prepared second patch version which fixes first BUG_ON only. checkpatch.pl also advises to replace BUG_ONs to WARN_ONs and 'unsigned' to 'unsigned int' however I'm don't understand what it's better here: - keep all as is, - or merge all changes together, - or do it in separate patches, - or do something else? I believe it makes sense to remove BUG_ONs in separate patch, or may be merge it with current one, but I do not like an idea to fight against bare 'unsigned' in fuse. Could you please comment it? Thank you, Vasily Averin