Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp46880rwd; Wed, 31 May 2023 18:49:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ46R42Kv7dfkLOxtoW1PVG6lPiYzfjE5qaT3NtHCbzj0oL98mGHcUo+Fv/wNn5nXp59yFZ2 X-Received: by 2002:a9d:4d8e:0:b0:6af:99ac:582a with SMTP id u14-20020a9d4d8e000000b006af99ac582amr4080251otk.18.1685584151882; Wed, 31 May 2023 18:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685584151; cv=none; d=google.com; s=arc-20160816; b=rPyPw/NXsxk9MybNJrFZG3DNgNd/go5J1wk8GQKbofcQd5BDWF2m3I92LbUNfpIOfW WCgHjZNYs6CGTPwHpJA6BQFlaldFQVEe/Zi22Ewm4pXOCkRH9qONapmZn9a10CzhqzKv y6hi0+p3uHPpUzIIouCxPYqAHP/m2f+EM/2hgByh4rCdaq+med9x3l+6uv0Q5aMjv0V7 qDYAxB1I/HGjh41Ly0BCQXP/6Ol8yDaGHj2i4eCzpHh3dwyNyK4eOncgKwhq+cI18ism NH38Gt/lhYSrprtBp/QD9pDXR8+busNUjByvbneUpq2kRPNHmHrMhTGeZ34I/+xlqrpi Gdgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=GfCZDw19eItHmYOBuJ4XIcrjln+xTuM+jQB23xwyQn0=; b=QRuSNZiuawf2Bd9tVssoSA53BWO6jZd2nKsaumYSDR9LaWcTBTU2r9vYnDT6f8Z/rG veqe6kd2SVPBf2qboxTge0E3ovovAHZ+ZGEVrfj+Ac0SDMClODOFKw8S66TaUtV2MszO ygG5ojAtpcRuiwPQgMhCLllX6Ar3WkRTQIgPIdZSMqY8ohHGZ2dARdDEzU5RQwnCmpSe ebd2rM2hemS576505uhVJ0aOhQ+MzaRZBO1O6pWQYzq5PjlIEVewV3TqLFdbc/zKt22t EtX0hlqMYGnmXSSiHKrV/BTXDy6DCsF3ygqAg9BomxRc+0V2HusW4EMo/9qKnj4BebBq phUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 125-20020a620683000000b0063b82c09424si4117362pfg.151.2023.05.31.18.48.58; Wed, 31 May 2023 18:49:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbjFABqD (ORCPT + 99 others); Wed, 31 May 2023 21:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjFABqC (ORCPT ); Wed, 31 May 2023 21:46:02 -0400 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AE6BA3; Wed, 31 May 2023 18:46:00 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VjzVehH_1685583955; Received: from 30.221.145.175(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VjzVehH_1685583955) by smtp.aliyun-inc.com; Thu, 01 Jun 2023 09:45:57 +0800 Message-ID: <33fd8e03-7c99-c12d-255d-b7190612379b@linux.alibaba.com> Date: Thu, 1 Jun 2023 09:45:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] fuse: fix return value of inode_inline_reclaim_one_dmap in error path Content-Language: en-US To: Vivek Goyal Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, gerry@linux.alibaba.com, linux-kernel@vger.kernel.org, German Maglione References: <20230424123250.125404-1-jefflexu@linux.alibaba.com> From: Jingbo Xu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/1/23 4:03 AM, Vivek Goyal wrote: > On Mon, Apr 24, 2023 at 08:32:50PM +0800, Jingbo Xu wrote: >> When range already got reclaimed by somebody else, return NULL so that >> the caller could retry to allocate or reclaim another range, instead of >> mistakenly returning the range already got reclaimed and reused by >> others. >> >> Reported-by: Liu Jiang >> Fixes: 9a752d18c85a ("virtiofs: add logic to free up a memory range") >> Signed-off-by: Jingbo Xu > > Hi Jingbo, > > This patch looks correct to me. > > Are you able to reproduce the problem? Or you are fixing it based on > code inspection? It's spotted by Liu Jiang during code review. Not tested yet. > > How are you testing this? We don't have virtiofsd DAX implementation yet > in rust virtiofsd yet. > > I am not sure how to test this chagne now. We had out of tree patches > in qemu and now qemu has gotten rid of C version of virtiofsd so these > patches might not even work now. Yeah this exception path may not be so easy to be tested as it is only triggered in the race condition. I have the old branch (of qemu) with support for DAX, and maybe I could try to reproduce the exception path by configuring limited DAX window and heavy IO workload. -- Thanks, Jingbo