From patchwork Fri Nov 17 17:45:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Watt X-Patchwork-Id: 10063071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 30AAE6023A for ; Fri, 17 Nov 2017 17:46:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 200652AD16 for ; Fri, 17 Nov 2017 17:46:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14F032AD3A; Fri, 17 Nov 2017 17:46:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1D3A2AD16 for ; Fri, 17 Nov 2017 17:46:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161137AbdKQRqX (ORCPT ); Fri, 17 Nov 2017 12:46:23 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:42578 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161118AbdKQRqP (ORCPT ); Fri, 17 Nov 2017 12:46:15 -0500 Received: by mail-io0-f194.google.com with SMTP id u42so9529632ioi.9 for ; Fri, 17 Nov 2017 09:46:15 -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; bh=jKISljdnOk4h9Grl4NHz0n5dAtzbp50LNrH8uIxSqoc=; b=JeP/OM+ejStCxeAhOJswWLVUHuLkuo6ES71wDtotzrJBZDO61XVjyv/QjA9fRnyCb7 eEvwzYnKYNtuhgJ+rYmwbch9Hn0Yla9ttYXLIJoklk0pd6eH1k3idrKzBYYyvHs3oWSB LntYLUraEFa7FTYMTtLCsuLifLUhrdifuVv2XhcqYtxOA1NIPOf8mGqm1yUHoVfJfaTh Kuj0NOuBJbXoSslz3XVWGtqvhcO9eki5RG+4o3VBxd0j1omxFtnADHhpG6JMQrLi7oPl 3HLWCZoos7n3KBC1zKpUDUCps4AyTfWVGnqNZ0CODfKHou8WMiRR1Gi31jTdKE+i5Dq4 FQIw== 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; bh=jKISljdnOk4h9Grl4NHz0n5dAtzbp50LNrH8uIxSqoc=; b=U7MNtLUMWnZfhm3iMmNkCpetdS1d2Dyc6KFyPROB2wxPWsVJJ8lcWjIfsW82gJd0U/ E7aePrFEaKWbUtAE4AyrQ95dKH3oJMXLO5ItYN70/zv7yysjJ7W/tZ2VUuleAy+jOPqS rrg/AxUZZK5hPpeD2cS1q/RjUm8apj9FXgTRfV2KxWroBSlc5UVQ2pm6Iq3zx46P/r8y IsHd1LjwufPH2Y+zXZxxkKU90KZZdwY4g5AqJUvHTuGL/+zhDItfRh3OOtJNNEsgHSlG UDZKCgjKseFGovvwwRO8dbp4cWS5aydYo7aRfe55HQt5hA5TxEFXZWNcCCkDkTyok5EI 7yWg== X-Gm-Message-State: AJaThX5wFa8L729MFtJ3noynwKA5CNkT6OkiDMs6kA3a2KD/noxtuAap 7P3kVhFRpkWPAV/2vBGsw8o= X-Google-Smtp-Source: AGs4zMbSrQp0nWizdESeOsWqE8WExVf3qir+Alq+mN/jXpkPoIlPbKmlPrOl+50BUeUVfyopwIdYcg== X-Received: by 10.107.201.78 with SMTP id z75mr3740198iof.123.1510940775022; Fri, 17 Nov 2017 09:46:15 -0800 (PST) Received: from ola-842mrw1.ad.garmin.com ([204.77.163.55]) by smtp.googlemail.com with ESMTPSA id h21sm1878189iod.59.2017.11.17.09.46.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Nov 2017 09:46:13 -0800 (PST) From: Joshua Watt X-Google-Original-From: Joshua Watt To: NeilBrown , Jeff Layton , Trond Myklebust , "J . Bruce Fields" Cc: linux-nfs@vger.kernel.org, Al Viro , David Howells , Joshua Watt Subject: [RFC v4 7/9] NFS: Add transient mount option Date: Fri, 17 Nov 2017 11:45:50 -0600 Message-Id: <20171117174552.18722-8-JPEWhacker@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171117174552.18722-1-JPEWhacker@gmail.com> References: <20171117174552.18722-1-JPEWhacker@gmail.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The "transient" option is used to indicate that the server might disappear unexpectedly, and a more aggressive behavior should be use to force unmount it. It implies "nosharecache" Signed-off-by: Joshua Watt --- fs/nfs/super.c | 13 ++++++++++++- include/uapi/linux/nfs_mount.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 71361ca6d6b4..09c413c098ef 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -90,6 +90,7 @@ enum { Opt_resvport, Opt_noresvport, Opt_fscache, Opt_nofscache, Opt_migration, Opt_nomigration, + Opt_transient, Opt_notransient, /* Mount options that take integer arguments */ Opt_port, @@ -151,6 +152,8 @@ static const match_table_t nfs_mount_option_tokens = { { Opt_nofscache, "nofsc" }, { Opt_migration, "migration" }, { Opt_nomigration, "nomigration" }, + { Opt_transient, "transient" }, + { Opt_notransient, "notransient" }, { Opt_port, "port=%s" }, { Opt_rsize, "rsize=%s" }, @@ -638,6 +641,7 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss, { NFS_MOUNT_NORDIRPLUS, ",nordirplus", "" }, { NFS_MOUNT_UNSHARED, ",nosharecache", "" }, { NFS_MOUNT_NORESVPORT, ",noresvport", "" }, + { NFS_MOUNT_TRANSIENT, ",transient", "" }, { 0, NULL, NULL } }; const struct proc_nfs_info *nfs_infop; @@ -1329,7 +1333,8 @@ static int nfs_parse_mount_options(char *raw, mnt->flags |= NFS_MOUNT_NORDIRPLUS; break; case Opt_sharecache: - mnt->flags &= ~NFS_MOUNT_UNSHARED; + mnt->flags &= ~(NFS_MOUNT_UNSHARED | + NFS_MOUNT_TRANSIENT); break; case Opt_nosharecache: mnt->flags |= NFS_MOUNT_UNSHARED; @@ -1356,6 +1361,12 @@ static int nfs_parse_mount_options(char *raw, case Opt_nomigration: mnt->options &= ~NFS_OPTION_MIGRATION; break; + case Opt_transient: + mnt->flags |= NFS_MOUNT_TRANSIENT | NFS_MOUNT_UNSHARED; + break; + case Opt_notransient: + mnt->flags &= ~NFS_MOUNT_TRANSIENT; + break; /* * options that take numeric values diff --git a/include/uapi/linux/nfs_mount.h b/include/uapi/linux/nfs_mount.h index e44e00616ab5..6067a9449d9f 100644 --- a/include/uapi/linux/nfs_mount.h +++ b/include/uapi/linux/nfs_mount.h @@ -74,5 +74,6 @@ struct nfs_mount_data { #define NFS_MOUNT_LOCAL_FLOCK 0x100000 #define NFS_MOUNT_LOCAL_FCNTL 0x200000 +#define NFS_MOUNT_TRANSIENT 0x400000 #endif