Return-Path: Received: from imap.suse.de ([unix socket]) by imap-int (Cyrus v2.2.12) with LMTPA; Mon, 11 Oct 2010 02:06:35 +0200 X-Sieve: CMU Sieve 2.2 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay.suse.de", Issuer "CAcert Class 3 Root" (verified OK)) by imap.suse.de (Postfix) with ESMTP id BE1103C416B3 for ; Mon, 11 Oct 2010 02:06:35 +0200 (CEST) Received: by relay2.suse.de (Postfix) id B466A18552E3; Mon, 11 Oct 2010 02:06:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by relay2.suse.de (Postfix) with ESMTP id A9D7618552E2 for ; Mon, 11 Oct 2010 02:06:35 +0200 (CEST) Received: from relay2.suse.de ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 29122-13 for ; Mon, 11 Oct 2010 02:06:35 +0200 (CEST) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by relay2.suse.de (Postfix) with ESMTP id 6B65518552E1 for ; Mon, 11 Oct 2010 02:06:35 +0200 (CEST) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mx2.suse.de (Postfix) with ESMTP id 14B278738D for ; Mon, 11 Oct 2010 02:06:35 +0200 (CEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752634Ab0JKAGe (ORCPT ); Sun, 10 Oct 2010 20:06:34 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:38170 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752630Ab0JKAGe (ORCPT ); Sun, 10 Oct 2010 20:06:34 -0400 Received: by mail-iw0-f174.google.com with SMTP id 6so2668490iwn.19 for ; Sun, 10 Oct 2010 17:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:subject:to:cc :date:message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=UJO3paHucq6OlKM06UEb1TVN7QqzkPyXWN7fNztk7mQ=; b=WGeehh2PC4rE1yirLXFQQ14UxrmfbbOCNqK2L2tESAaywDxoDSFRMJzdR885ARlMC9 GZwggetqRpo+LU2m36u2ZeE3gtOIFCZ23GClQbdRUiKKMwzRpWbP3vfEt7adJIV2RjsW thMkV1EOnxeJMpP4IJdRRXxJ8tXkCaHjwzj38= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=kL7dvDU66o7mLvoqMOG0Xw/RxY3rj5LA9DjPUc79e+XB9OxHuwVhwbzwL0dCaBmD16 VhumTwhcPLN/wEkiuSMe/Tsu3di038gQL/nz6zBeszxC3JVrDO5aGw/DAsT0fcipVNyg sJR3xvqRVFuH7VtO1a/HugVzTwMiCt+EBcvRY= Received: by 10.231.12.133 with SMTP id x5mr2060586ibx.131.1286755593267; Sun, 10 Oct 2010 17:06:33 -0700 (PDT) Received: from ellison.1015granger.net (adsl-76-241-169-38.dsl.sfldmi.sbcglobal.net [76.241.169.38]) by mx.google.com with ESMTPS id gy41sm6552605ibb.11.2010.10.10.17.06.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 10 Oct 2010 17:06:32 -0700 (PDT) From: Chuck Lever Subject: [PATCH 15/15] mount.nfs: don't show "remount" flag in /etc/mtab To: steved@redhat.com Cc: linux-nfs@vger.kernel.org Date: Sun, 10 Oct 2010 20:06:30 -0400 Message-ID: <20101011000630.6667.13971.stgit@ellison.1015granger.net> In-Reply-To: <20101010234836.6667.4057.stgit@ellison.1015granger.net> References: <20101010234836.6667.4057.stgit@ellison.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: by amavisd-new at localhost X-Spam-Status: No, score=-4.999 tagged_above=-20 required=5 tests=[BAYES_50=0.001, MY_LINUX=-1, RCVD_IN_DNSWL_MED=-4] X-Spam-Score: -4.999 X-Spam-Level: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.2 Don't add the 'remount' option to /etc/mtab. This is the same behavior as file systems that use the monolithic /sbin/mount command. See the MS_NOMTAB macro in utils-linux-ng/mount/mount.c. Note that mount(8) has MS_USERS and MS_USER in the "nomtab" category as well, but mount.nfs needs to record those values so that unmounting a user-mounted NFS file system can work. While we're here, fix some white space damage in fix_opts_string(). This is a partial fix for: https://bugzilla.linux-nfs.org/show_bug.cgi?id=188 Signed-off-by: Chuck Lever --- utils/mount/mount.c | 4 ++-- utils/mount/mount_constants.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) --- nfs-utils-1.2.3.orig/utils/mount/mount.c +++ nfs-utils-1.2.3/utils/mount/mount.c @@ -209,7 +209,7 @@ static char *fix_opts_string(int flags, } if (flags & MS_USERS) new_opts = xstrconcat3(new_opts, ",users", ""); - + for (om = opt_map; om->opt != NULL; om++) { if (om->skip) continue; @@ -281,7 +281,7 @@ static int add_mtab(char *spec, char *mo ment.mnt_fsname = spec; ment.mnt_dir = mount_point; ment.mnt_type = fstype; - ment.mnt_opts = fix_opts_string(flags, opts); + ment.mnt_opts = fix_opts_string(flags & ~MS_NOMTAB, opts); ment.mnt_freq = freq; ment.mnt_passno = pass; --- nfs-utils-1.2.3.orig/utils/mount/mount_constants.h +++ nfs-utils-1.2.3/utils/mount/mount_constants.h @@ -64,4 +64,8 @@ if we have a stack or plain mount - moun #define MS_MGC_MSK 0xffff0000 /* magic flag number mask */ #endif +/* Generic options that are prevented from appearing + * in the options field in /etc/mtab. */ +#define MS_NOMTAB (MS_REMOUNT) + #endif /* _NFS_UTILS_MOUNT_CONSTANTS_H */