Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1380687rwd; Wed, 31 May 2023 13:06:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LuzHp2wr00pEgLXhoQZgzTszfipFEwY0+huu4GIliZkImdkEbC+fBlB/GdWe5LT3/TczN X-Received: by 2002:a17:90b:33c7:b0:256:7283:a881 with SMTP id lk7-20020a17090b33c700b002567283a881mr5674647pjb.8.1685563610004; Wed, 31 May 2023 13:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685563609; cv=none; d=google.com; s=arc-20160816; b=DBFKCb15oDWeG9dNYSEPQk1Ba42gUPZYS4y2WjOLySiztzg4lbxUnV0mt2iLwhvpqx cM1zthEA/fCVXbMA2SC4vCx4pEMZ+m/kX+NIghRsIaBGLnW7/oca1cisiKRyCeSU5IHo 0k4tQ7WKpyQPgAd9NWZoi/dsz9aVE3lK+NC3WN/qBli6fK/fp8pUOCsFQ8O+pfdjg4HY AQ8iGvHOwCWgupQDzK4btlvMkRuU1ODnrheeg18slfagrtW6l0yjHGO74vHQcwnZ6x3T nf2VyBdFd+T9q2mF39h+e9Th2oZZ7OaQz8kUM+PDJ8twHdkCmTS8xJpQHVJmywvT1+07 fz3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kNA2ebP/Kk24u5JXiZiwF7lD7gfc/9bE909Ix3mRLxI=; b=Xn68fYEYBajazww6Q7mkmBsLBJYdNfdu+pmj93NcLUaXZNsNl+yEvOGusqhW4kKeWK HKCBvv+xZwHiKINi0CWKls1i0N48W8hNidwY1EY5vd6FCNFCre9a9ifzddD0LCq4C4e3 GydztxbGt8HQ2QEqvwEyBUBurhZB7hMrcwzWJIyThGWsXYHP3F51RjI+fCWLkhbFsw2i guYOgyIji5Ksey3BRLPlXb1t0T4NRGLykni+rjtVhZHRM2rjIQkQDeCJqY+t06CDpLHa 0cPIeb/3LwdzfzP75dpBaoy13YsymWYuf+MXO6GRgX5tig7H43eVFLPvw4MdEouZoOSX ewFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P3cOH955; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e68-20020a636947000000b0053eef685a0csi1485800pgc.852.2023.05.31.13.06.36; Wed, 31 May 2023 13:06:49 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P3cOH955; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbjEaUFq (ORCPT + 99 others); Wed, 31 May 2023 16:05:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229651AbjEaUFo (ORCPT ); Wed, 31 May 2023 16:05:44 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEF74137 for ; Wed, 31 May 2023 13:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685563492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kNA2ebP/Kk24u5JXiZiwF7lD7gfc/9bE909Ix3mRLxI=; b=P3cOH955ZD771FQo0moJCIiRV3b2ValR/6q0KER2TacCw0CIcDxy9kJ2X/iFgkIokPCWEB V+ZO8vve7+b1+Crag0hOmp2QmHpDdNpGRawynscB3lmXmNt/WpuC8O8UpfDlT3ReUuM1vp ZyAfsEXSauRvJSuRf+cZi9d46M+V25o= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-315-noSna6GIOauu1C41_KaVCw-1; Wed, 31 May 2023 16:04:07 -0400 X-MC-Unique: noSna6GIOauu1C41_KaVCw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 792A6858EEB; Wed, 31 May 2023 20:03:45 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.8.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6228F492B0A; Wed, 31 May 2023 20:03:45 +0000 (UTC) Received: by fedora.redhat.com (Postfix, from userid 1000) id DCDB516EF93; Wed, 31 May 2023 16:03:44 -0400 (EDT) Date: Wed, 31 May 2023 16:03:44 -0400 From: Vivek Goyal To: Jingbo Xu Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, gerry@linux.alibaba.com, linux-kernel@vger.kernel.org, German Maglione Subject: Re: [PATCH] fuse: fix return value of inode_inline_reclaim_one_dmap in error path Message-ID: References: <20230424123250.125404-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230424123250.125404-1-jefflexu@linux.alibaba.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 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? 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. Thanks Vivek > --- > 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; > -- > 2.19.1.6.gb485710b >