Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp911278ybm; Tue, 21 May 2019 05:50:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyymt3g0GUs4O97JR3eX0KYkHI5kuWrSfHqq5j0V7dRcuen1/7GKH0XFM4JbDqtCCIISeo/ X-Received: by 2002:a63:1650:: with SMTP id 16mr82620645pgw.164.1558443004332; Tue, 21 May 2019 05:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558443004; cv=none; d=google.com; s=arc-20160816; b=Rxd48fmSmX3W9C2FudqBwg6ydOrzoyTWO9wZxx85och2fHv3cDWwrtGmRnN1fRXdXH eRJVCio7pecqX6uInjYRU0Y010qqskC5MdnVSYbQB4Ki3LKGBo61zYWHVpOUW/tub+pz TqEFAUmkiE666pFWt0FxNRRF7iR+y2qZCrDExlCWmSXsQodE7ncrh8z+0okUAAfw4WMl oTMdgJqE+hPCGIcp+Z92iNiubTOkIL5JPFf9P/uuta6dZB6ofC5iYIDrkQc8medZFHyG o7reltlqkLavbtmD+TgBSsBJu6Yq8IBuXkICnqXb6pYcv8/6UBQNrnUXT9XP5yEKL8n4 7Ktw== 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=0106F+OIYuqVEg46cY8S9oFV/iyDhlYutv2OgfNUAlo=; b=j1K4+Na828EV0OadxyrJmBUmsst1LlWpMzHmRrmD2kR/ZDppO8gAdTEDpFVG165zgn qqK7NAYhzRR3mrkUHhzQxnt//QNDV9gABiUwVWmems4uR5Dmt5QpMUpbZEolJ3YOXIVt IXRFzwgL6FL8evrCirL3wHyycdlYaC6Nu2nfz6mqb+w7pxvxg3meTLdTxFRuKFujoM9R s2mmXcg51Q8aX/79+ck0LFT384Yj+TzG3GB0c0CXR/IOU+4gfcm99sCokSRfpTO6id68 ZEzsFIzG/z40mO2/KnVEqEhWpJ/5qvaKhrhC9plqGLp/k9TgLZ4c+YOT92JKpozLR7Xf bBLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Qiz7dc11; 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 p7si12088987pgf.532.2019.05.21.05.49.50; Tue, 21 May 2019 05:50:04 -0700 (PDT) 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=Qiz7dc11; 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 S1726344AbfEUMtO (ORCPT + 99 others); Tue, 21 May 2019 08:49:14 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:52574 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727251AbfEUMtN (ORCPT ); Tue, 21 May 2019 08:49:13 -0400 Received: by mail-it1-f195.google.com with SMTP id t184so4724034itf.2 for ; Tue, 21 May 2019 05:49:13 -0700 (PDT) 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=0106F+OIYuqVEg46cY8S9oFV/iyDhlYutv2OgfNUAlo=; b=Qiz7dc11EDTEqdsK5oApuPDxvOXOKwXD/jxZ+aigDpohi7I8p5j86ZUyBTusTi6bjx /0+RtPm+ZCfSqrKriBAILDDAM35BGuNzwMn5YkW/9uOOAMFju0OCzo5MlTuk1QrMRu+e +KMPoTfY1T4ZJ2ZdwHe4SEOVh+EyQ5svDseQU9apdO2zPYzLkU4SS2UqKP0tRzWfDt3y Sb9nQ5aKXSnqtHwCRpPHmHaKH1dI9PleROWhECRE20jSgUiM0EFUoKyvYHj9wS+3gYlQ dZ3v5ZmgnOfmtbIyrOUpEDiGGCX6yXvOI6F0DL+YtvkxvL0YzA2qfXh1XVe3XvQAV2gv T4CA== 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=0106F+OIYuqVEg46cY8S9oFV/iyDhlYutv2OgfNUAlo=; b=N+E5EJ7/TEhfvB/mEpmk8oRP+k3mo0heUdYm7OJMtCnbnwiipM3mXSVBBZ1lKqJ+sl taNjR9s3y8N3aZ7Qa6brRRI/SO4f4pDrkpKmxOkx8EBV99wZCyNtavXuPzJW6iZchs9B 4PQWEAyJLs0NA/HtOpB8GLOFVX257pODDfcWDRVaDDAss1uyIujSClXg9UsO8H0GmX+Q yB4sWnO0dyRj1ywEM40Htt8kHj1vosQoBrxdTc25/7eWjCC2BRYVGU898MLIS1Gtqjoa FBczh/d/gYG6NbGcvlqqV4DKKUtqs3q9iFerqMQzR1TEtTzyJfFSyeEn1WZbXfTSrwIF z3BA== X-Gm-Message-State: APjAAAWWifz4LGi+rbS4hFZdpKM1vdCq9byhmTNqsVOQE83hNhVGPuu+ F0FW/wcsyOWu/3hKilTABw== X-Received: by 2002:a02:b38e:: with SMTP id p14mr6114963jan.43.1558442952699; Tue, 21 May 2019 05:49:12 -0700 (PDT) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id v139sm1693180itb.25.2019.05.21.05.49.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 05:49:11 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: SteveD@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [RFC PATCH v2 1/7] mountd: Ensure we don't share cache file descriptors among processes. Date: Tue, 21 May 2019 08:46:55 -0400 Message-Id: <20190521124701.61849-2-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521124701.61849-1-trond.myklebust@hammerspace.com> References: <20190521124701.61849-1-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 Sharing cache descriptors without using locking can be very bad. Signed-off-by: Trond Myklebust --- utils/mountd/mountd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index fb7bba4cd390..88a207b3a85a 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -836,8 +836,6 @@ main(int argc, char **argv) if (!foreground) closeall(3); - cache_open(); - unregister_services(); if (version2()) { listeners += nfs_svc_create("mountd", MOUNTPROG, @@ -888,6 +886,9 @@ main(int argc, char **argv) if (num_threads > 1) fork_workers(); + /* Open files now to avoid sharing descriptors among forked processes */ + cache_open(); + xlog(L_NOTICE, "Version " VERSION " starting"); my_svc_run(); -- 2.21.0