Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1616390rwd; Thu, 1 Jun 2023 19:32:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ELfqr114YOlZKzr3z33xi55t0ZeR7vm/Q9PwVLu72DhMat7hYUc9MWlihk4QZ37buYrP7 X-Received: by 2002:a05:6870:a606:b0:196:5925:24cc with SMTP id e6-20020a056870a60600b00196592524ccmr845299oam.21.1685673129939; Thu, 01 Jun 2023 19:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685673129; cv=none; d=google.com; s=arc-20160816; b=JKIfB74j3IZWstUMOjzOsrQFOcZdl9KZ9mSLYdyAblKbGERIfAmcPXWGM5lW0mGK8y iVFt2rvT+Av3cEtbwV1Uxi8lvJqVHayAqkpwMRh9rfujNV/JaEpXq59Ww8a6egVxaxzz E5JRnmCnZgI7r/nJL0RoJgZPCrzlpuwhYzBsV2UR/+yj03p00xHfJ2YgIaKcrkUL7Jgc GDBT+7gXoNtObhOrvojRFYkhe9xW05Wz6pRPEaZCCnCzR1ucd/FLmy115PXR0UMoU222 c2g8CeFNdW5II/3DxLaVPTwNnUaPKcXlX0CXhDEHs4wNKfgbpemJNsWd5tGDizLgShhE 2Ybg== 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=WRjlq3xdoGcIb6L2ALkCQKQZh2cwcU0YitaU+qUkqho=; b=hWXZXmks3C3VeOIYeDmlFrO0fP2KlXSFnLZfRRcqDuH59uciPDOIahBe43wLmpEWK2 4FrATXE/gw7vo2eU33VwY7h6eAz/i0+gEeKYPuX28sQfuSNtZpPYTVvGV07Nf5xX0rJn 9vj6I79uYeK668hNvuh4GnjkPUhSeCiG/0LG+8P/tGMaJ5+6XWfsHslG4mqM4CW9qfHo NNjmDi2rKxW/pczK1GmrMt6uO+OwU8DjGbDjERCAwSi1Br80l8alk1XCq8QYoWqoSoke p3P2lhPWhJ83/ek9rfmjKHElMMP5ybfNUxHQI2EL0CC3GwFfFnoWraJ6Chlpl25YSA4U aJwQ== 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 h5-20020a170902f7c500b001a64e7b702fsi95526plw.447.2023.06.01.19.31.54; Thu, 01 Jun 2023 19:32:09 -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 S233316AbjFBCBq (ORCPT + 99 others); Thu, 1 Jun 2023 22:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233162AbjFBCBp (ORCPT ); Thu, 1 Jun 2023 22:01:45 -0400 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72E2EF2; Thu, 1 Jun 2023 19:01:43 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R411e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Vk7tVxr_1685671299; Received: from 30.221.148.89(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0Vk7tVxr_1685671299) by smtp.aliyun-inc.com; Fri, 02 Jun 2023 10:01:40 +0800 Message-ID: <0401ac2b-2b09-68e0-f687-152eaa12b0cc@linux.alibaba.com> Date: Fri, 2 Jun 2023 10:01:39 +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> <33fd8e03-7c99-c12d-255d-b7190612379b@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 7:45 PM, Vivek Goyal wrote: > On Thu, Jun 01, 2023 at 09:45:52AM +0800, Jingbo Xu wrote: >> >> >> 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. > > That would be great. Please test it with really small DAX window size. > Also put some pr_debug() statements to make sure you are hitting this > particular path during testing. Got it. Thanks. -- Thanks, Jingbo