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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 D23D0C3A59B for ; Mon, 19 Aug 2019 06:52:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B135420874 for ; Mon, 19 Aug 2019 06:52:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbfHSGww (ORCPT ); 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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