Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1425321rwd; Tue, 16 May 2023 17:32:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44zQKsJ9S9mGndC7aXyXKEgDENLXpCJQdSFes4ClCvPPXfvj10EmkhIz4KnhMGAjUUhtJz X-Received: by 2002:a05:6a20:4293:b0:104:b7b4:e03b with SMTP id o19-20020a056a20429300b00104b7b4e03bmr20769562pzj.48.1684283574192; Tue, 16 May 2023 17:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684283574; cv=none; d=google.com; s=arc-20160816; b=zcJ1PHK4TFFfWuLmq3Zx/dBBuboKozv/d++lyAwahoPwvhi8hhbJhjR3LtzVw8gc55 1d9nKhIQVTbWu9fXO2OVI0X+owMskssC77p9yKgPOeaRM9VqRyYd1Fq62KYI79vXudFk KMBvu8xWnXtUKdi22nH2BqrFjqP8yo3TGU91GoRd80ZhE1lD0knCGsi8QoxJiVz+Wdil VwSBeez6I1rZmSZBxD3DtX8W3POk5vtbB6NxDUI/kzPba5XvXtJR0sCQnepWXycwLBdO 8DAGqxbFQNgblfz6jXB1vnacw2uxL2x2SK5T9D5K1iLUD1lIDE4Z9mbnnUHKSZ7dUmtq uNSA== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=kt/fTPbgZoqcTvU599IEHwNdzqr8aWwYv976sUVwElo=; b=agWzsUCLZEIrcIAwdVjNKTvd+ADN8Y1+snkvHlguWUjPx2vQUjZZH2udINf8JY/XdN OiFvascIfrEsL3gElpEgHRrhbeech0OYGoJVIavT2fopsCSjxDy8/9aJCAmBy0ZGxuS2 eaR9qTpTKz8AQdplrSvzKnyk2YRgiQr7ShZN4Ag68XHMCxuk/CepntnyqVwQsNcj0GK7 ejw30aGKJur5BPvIwPL32vhMQlyyW5wXANf9fevKn1nUjnab2gd1M+f24fsik/C+FXJ0 Vx60AVOIPQWQn5WGlM5FgKVz5tPVIq2NVoEaCCD85sMgUIKvZu9Px04QngRVTQXkdMAE 4ZGA== 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 k12-20020aa79d0c000000b0063b71d46b6dsi19954886pfp.75.2023.05.16.17.32.41; Tue, 16 May 2023 17:32:54 -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 S231478AbjEQAID (ORCPT + 99 others); Tue, 16 May 2023 20:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231452AbjEQAIC (ORCPT ); Tue, 16 May 2023 20:08:02 -0400 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B13E12F; Tue, 16 May 2023 17:08:00 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0ViqAzYl_1684282076; Received: from 192.168.31.58(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0ViqAzYl_1684282076) by smtp.aliyun-inc.com; Wed, 17 May 2023 08:07:57 +0800 Message-ID: Date: Wed, 17 May 2023 08:07:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH] fuse: fix return value of inode_inline_reclaim_one_dmap in error path Content-Language: en-US From: Jingbo Xu To: miklos@szeredi.hu, vgoyal@redhat.com, linux-fsdevel@vger.kernel.org Cc: gerry@linux.alibaba.com, linux-kernel@vger.kernel.org References: <20230424123250.125404-1-jefflexu@linux.alibaba.com> In-Reply-To: <20230424123250.125404-1-jefflexu@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,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 ping... On 4/24/23 8:32 PM, 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 > --- > fs/fuse/dax.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c > index 8e74f278a3f6..59aadfd89ee5 100644 > --- a/fs/fuse/dax.c > +++ b/fs/fuse/dax.c > @@ -985,6 +985,7 @@ inode_inline_reclaim_one_dmap(struct fuse_conn_dax *fcd, struct inode *inode, > node = interval_tree_iter_first(&fi->dax->tree, start_idx, start_idx); > /* Range already got reclaimed by somebody else */ > if (!node) { > + dmap = NULL; > if (retry) > *retry = true; > goto out_write_dmap_sem; -- Thanks, Jingbo