Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5849251ybl; Tue, 10 Dec 2019 12:31:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyHzWnNGrc5gX+1Rxxl61XsBy8f3Iqwot1m2YMF4oGHx2XoXhDPwJ/DLP2q9ghqOWxdJybJ X-Received: by 2002:a05:6830:1498:: with SMTP id s24mr27202001otq.208.1576009868988; Tue, 10 Dec 2019 12:31:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576009868; cv=none; d=google.com; s=arc-20160816; b=xxq1sAZ0/qz+iguZcTfhwbe8z6Smw7JJh92vVlKiwxuaBeFPAh8qwooZ3Worf8r6CS 2y9c5IMJO8qnksocTL2qgMuYb7a3c6nwbi6T8CGj9mP1aqZa8KG7mOP7Ggx8enJJh+dB BTaEob6DdruSrq1g0DRxjT+CJTZdKHbpqWH80rBVA080oD1d8YEiKgXS0CaSnnMhewu9 jgckb/JihGXuxAqDOfbgZLE/5l9h1p8goMzXJ3cKOinciaXAKC93oYx2CZIZxe+0kroM wkdY78Cl1kwMQ8gPdc18gwu6si8XRkfF5j65H+ydcIYLgzN63k3ja8r9a8F+TMTNYU38 vt/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7GB97zh1aT6vdl33UGntJyfknfwBcQGtnm/vtVyhwkc=; b=1A1tXIPzbjFhR+AZ6ntodEYosANRLm+SuqjDNgZXcoNtbgivnrqfxTZncQQi/NNYfn Lj+4dOeeLqsOKi/A6mLrpdzwiqi+w4k4rZXWILWuGJJN95ViCE/LzK7SwwtfHynQIDAi Osx027V3Nu6ox48oz9rp8uP843HPtwSx5Av9hViQkvthNnBkAawA/fLZtZ9pWJ/Bw//p rvNIvSobwQpYiTpFu+X4VPVQdtgFXBoRcMc9oFgrkINUAOXPM0eGr8lYMf5hUTd0a5lf aZ1opHOceaiY3lNzJ34u8ZkGkXErGl60UUA74tzEHWpHmBfFQ94KqiqKZXW2XLVHxsR+ 8Rxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E0WMenFL; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si2650808otq.28.2019.12.10.12.30.56; Tue, 10 Dec 2019 12:31:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E0WMenFL; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727051AbfLJU3w (ORCPT + 99 others); Tue, 10 Dec 2019 15:29:52 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:42742 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbfLJU3v (ORCPT ); Tue, 10 Dec 2019 15:29:51 -0500 Received: by mail-yb1-f196.google.com with SMTP id p137so8145900ybg.9 for ; Tue, 10 Dec 2019 12:29:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7GB97zh1aT6vdl33UGntJyfknfwBcQGtnm/vtVyhwkc=; b=E0WMenFLIw7i8U3xI3M6IjJEkbFjrj4ewyToVXMjne2R8FyI8s9DNfcPpLuU2Mjqg7 lTFIul7a7LxELPqONtMKbNNtVBk5NrFFxO4eum60boa3GC7U2ft50POfY9uNaUR2yI2x pejAPcwmGwf8fkaImRaEtldh2nUFXHu1rio0r3YNjJs+AJY5wm0O/4v6qTRS+rj+x8SZ V0SkAqfZ2dJsC9YSER/xQ5jisZ2ZQNduUl4tpJacC5hhglJe0+yyxrB7KZrrrR/YFoPF fw0Qvzqq8BrBO5an/GVzYdxSRBEr6Zpph8mEMRnlRTaUhs7Tp93gwi8qpilTiyRGdrS4 uZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7GB97zh1aT6vdl33UGntJyfknfwBcQGtnm/vtVyhwkc=; b=lBkpyM/gkVqIL6OIQrBLxI1AA1hzT1ELhqQ9vAARaPumg/+B7gppCektj2jIgL+4Jn Q2roCUsNSMkIl+VtzZKmd4VK3pNgutS612rh2+oji0INzXhXCQSySCEJBpPeN2q0IW7C 0mU4LVJGZifJ1SrgDKQncCxInobLdbzlVbOifaGjq/AC/rqge8MO1ponzfzs3eKWiNUM br8N6WzdSIQYJLyBsmcxAd65MKIEUMEqCndxx4ceI+317LRFuL5D9Vc68me9YndDGWVA zdXJh0G0GBa4F4XrM2aqCa646GraMfLB+SvUQvSGwo0cYFJ0eKKCJ6zmyiEXebdU0CjG ZkwA== X-Gm-Message-State: APjAAAV+Onen1/+8REL4Fto1eEf8SGoTNmhUSdb1UR2kDS8QtYULk5qJ N0acsproQXjMH/h3+NJWDg== X-Received: by 2002:a25:d45:: with SMTP id 66mr24922384ybn.216.1576009790487; Tue, 10 Dec 2019 12:29:50 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id x84sm1947508ywg.47.2019.12.10.12.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 12:29:50 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: "J. Bruce Fields" Cc: Chuck Lever , linux-nfs@vger.kernel.org Subject: [PATCH 5/6] nfsd: Schedule the laundrette regularly irrespective of file errors Date: Tue, 10 Dec 2019 15:27:34 -0500 Message-Id: <20191210202735.304477-6-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191210202735.304477-5-trond.myklebust@hammerspace.com> References: <20191210202735.304477-1-trond.myklebust@hammerspace.com> <20191210202735.304477-2-trond.myklebust@hammerspace.com> <20191210202735.304477-3-trond.myklebust@hammerspace.com> <20191210202735.304477-4-trond.myklebust@hammerspace.com> <20191210202735.304477-5-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Emsure we schedule the laundrette even if the struct file is carrying file errors. Signed-off-by: Trond Myklebust --- fs/nfsd/filecache.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 6b0ab43b0618..4cef03a7726c 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -237,13 +237,6 @@ nfsd_file_check_write_error(struct nfsd_file *nf) return filemap_check_wb_err(file->f_mapping, READ_ONCE(file->f_wb_err)); } -static bool -nfsd_file_in_use(struct nfsd_file *nf) -{ - return nfsd_file_check_writeback(nf) || - nfsd_file_check_write_error(nf); -} - static void nfsd_file_do_unhash(struct nfsd_file *nf) { @@ -307,10 +300,9 @@ void nfsd_file_put(struct nfsd_file *nf) { bool is_hashed = test_bit(NFSD_FILE_HASHED, &nf->nf_flags) != 0; - bool unused = !nfsd_file_in_use(nf); set_bit(NFSD_FILE_REFERENCED, &nf->nf_flags); - if (nfsd_file_put_noref(nf) == 1 && is_hashed && unused) + if (nfsd_file_put_noref(nf) == 1 && is_hashed) nfsd_file_schedule_laundrette(); if (atomic_long_read(&nfsd_filecache_count) >= NFSD_FILE_LRU_LIMIT) nfsd_file_gc(); -- 2.23.0