Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6789147yba; Tue, 14 May 2019 13:46:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiSrDnkjKixDqXyshFVPiiibNvm1cpIeL+2rTICYauetPamZotyF4ZOi0jBkDfa4OIt4rF X-Received: by 2002:a17:902:a508:: with SMTP id s8mr22048063plq.186.1557866784359; Tue, 14 May 2019 13:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557866784; cv=none; d=google.com; s=arc-20160816; b=QUWdRcf3CJAxWvt/YPYVKJTbIDE/3oP7QyBBd0gRg2WFaHDknT8FlaV0wN422MvcIf hvlZREgJWv2wiYY8NsAgP89one0oRphnTvvghcc+8n/281YQjBY5sl6isQ5ccD/ITF9f k0bupzPPD9jSc0nLKzquOhJMdWV0OTPPrwPccSPrACbR80DDexG1RCCPXvij4y71whRW m2H8NGUoIKXFI/cGWVqs1lW0ATD4FiXnFUOT7UyFii60KW4uUEo7oFL1cL601J3CyBr1 q8+WPDb/dAVdT3ReKyrlV95m21Oqd20DNB6LTP9tDXAGEDsGY0joFUYpy1A+wTWw+VlZ ExAw== 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=VZN6vkZeakWtE0BuB1GpZhdqhTam212VSl6p78td0X2+bfxL+C4nCGXsOOjN/OqVz8 KzpbfUjY92mBwHmaieZUaYLrELWBNJzAiVgpem2oHDLkW42vojokQvXaYlIuIQxpXC77 VJxIbxlp4uD1JuK2AGaOJYEQGoQX1926dpG++6R6eegz0U9GH72Yu0E5JY5T9Kr2MpcZ uZW0nFSQlhR2gsK5v19jmCXjNsOUzEnDg2p/WzqV8aTNSAZDOA5w1ugYIt3jlauFdqzx mS+nqfrRtYjHvrQroG0rz7gjXeIa1I5syftqz80XOOlgopYW3wrO20fZj79+r5rgT9qV 0OEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tiCdkSQx; 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 t13si20083389pgh.548.2019.05.14.13.46.10; Tue, 14 May 2019 13:46:24 -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=tiCdkSQx; 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 S1726211AbfENUpY (ORCPT + 99 others); Tue, 14 May 2019 16:45:24 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:54148 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726134AbfENUpY (ORCPT ); Tue, 14 May 2019 16:45:24 -0400 Received: by mail-it1-f196.google.com with SMTP id m141so1140066ita.3 for ; Tue, 14 May 2019 13:45:23 -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=tiCdkSQxIAHKjBLpNf2brYkBehQrE7qKRql2fvJbkxhezbkN5u1/8eMwXisCaHuocN eebBlCCOGdF8lLQRj8oQDpRVMyuYptoXBc5hxcv+5bHBvuVbY+f/nezyQZPpExEkKx6C WUl0/scGv/3VI0+VUHh1/WgJsyDu2hQs3oKs3i11mv71brk2QaH2rGKNurqBiirOyMIO Vl2tGtgPh7ygZnbIpev4gLWuxivqtMY7y7WFvPnH3e52APd2g4yHppbvMs8mvDhSSN5n tbVFLf2Oc6pIOQXqIwofgvImvoedOW2WHIHomdMigiRUHcj5dqVtIVF2dASdluKZXjOQ T5rg== 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=dEsLZ9mU+eVU2y+nBOyo7vx3mg5vxII0JLkPLkndSvqKoD+wk1xWXGLKsNSdLvb3wu FdubzVSsnMufz6mwWq6awpDKwcXFcdO7vXKuQq5eRUsScYa2XFjMYdp/+8xAExV5YnwC MP2MBgmfYZsU9YrHCVTzHRCEXc/3oRShIiZ/al79yMFCtA4ys9n04tk+De/zBUmuAdzi OsXXS5to5ZxjQIm8jRc57yLoaPPRgBdErgKA9cgyT9Mi15AgAxUFKKXfS+LX6lQb5oYF lmetT2NMfPDqBxw3M3cgnBizb2fFDYEOi1due6SZs03KsTuG7kfkpoGmLCmu77rjP+u6 23uQ== X-Gm-Message-State: APjAAAXSIupSmA9Jrk4rFzUeTomN8BVyVKu7yY42KyecEt/3tiyxerxA 9YIHui94cZYNieJmtpSYvA== X-Received: by 2002:a05:660c:552:: with SMTP id w18mr4864150itk.26.1557866723189; Tue, 14 May 2019 13:45:23 -0700 (PDT) Received: from localhost.localdomain ([172.56.10.94]) by smtp.gmail.com with ESMTPSA id r139sm64943ita.22.2019.05.14.13.45.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 13:45:22 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [RFC PATCH 1/5] mountd: Ensure we don't share cache file descriptors among processes. Date: Tue, 14 May 2019 16:41:49 -0400 Message-Id: <20190514204153.79603-2-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514204153.79603-1-trond.myklebust@hammerspace.com> References: <20190514204153.79603-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