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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DEE0C7EE2A for ; Fri, 2 Jun 2023 02:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232248AbjFBCBr (ORCPT ); Thu, 1 Jun 2023 22:01:47 -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 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