Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp735370pxj; Fri, 7 May 2021 20:15:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5b7A6DuQLSMu/RaNB0nkRl5UQQ/MfZC12liqsp3pnKCoN/17KjQjQekKGqfjslpK8UDs7 X-Received: by 2002:aa7:c9cb:: with SMTP id i11mr15749199edt.331.1620443709866; Fri, 07 May 2021 20:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620443709; cv=none; d=google.com; s=arc-20160816; b=YnEwTUtuVVX4jcVdjNiq6p+2XXBraAOllPTVWoZkRI5evkrVTHGVJLmO26r9IW1N3G yJ+RLQzR4LAiBrkk6YHRZLwNsCc7qLJ2UhnE8qzj7vMH8dAdcU9rUV7UfOV71PKXdzfy BqoiQXWzmtTM8+e8Derrjb6Ghh1IIADVPiTMOKXZk9a33X5QSUZL+W9jZ5sex9kkSw3K V8K9hZFb34to1cO67kXemHvxBEaXOr3spLUhKaP4ZU4kG1z8d/S7SlGTRLLeRt/fl8nL jZWNP9hLhyikF1hUw+iiJ2FPtIyLeh9ABpvr/CAjydeAGlsNXN9KxThLRYJvfuq4PCiq iaig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:to:from:date; bh=3tXKXoZ2DodTaWc4uHUAd/99q0y++x/mCVSd0ZFRTN0=; b=SbwNj4tJd8So2+rF+Xt710G/EruHnlsLGRhWrYoMB6emansu15enwQRItZOrH45Gvw BxnVEot5ULCC/x6brFwG0mXtlt6cl7oE/KfrmY82awaw6woxfK1YAqQxidMWaHrglAju txnrYOoEcyyV+msfJTRd6fU6wBuZPSDUTpTdXj/vZ/UYaBHtx/fAsfhKiXB4zhCRA6zJ RkXJB3M1QbQeqxV9i3ocrgYKY9NK2aOJ3ek+izDQBstXlQHNDNvVIIBDAVVtdCec0VVr 6QXoMu+2+lElQhWOID8+gjzIaN7HD+Nn7xBkUMghp0uAplj9QMy55MqDb9StSorzeUqy ZHMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si6866417ejb.4.2021.05.07.20.14.35; Fri, 07 May 2021 20:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230355AbhEHDOg (ORCPT + 99 others); Fri, 7 May 2021 23:14:36 -0400 Received: from server.atrad.com.au ([150.101.241.2]:47902 "EHLO server.atrad.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbhEHDOg (ORCPT ); Fri, 7 May 2021 23:14:36 -0400 X-Greylist: delayed 778 seconds by postgrey-1.27 at vger.kernel.org; Fri, 07 May 2021 23:14:36 EDT Received: from marvin.atrad.com.au (IDENT:1008@marvin.atrad.com.au [192.168.0.2]) by server.atrad.com.au (8.15.2/8.15.2) with ESMTPS id 14830ZW4009255 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 8 May 2021 12:30:36 +0930 Date: Sat, 8 May 2021 12:30:34 +0930 From: Jonathan Woithe To: linux-nfs@vger.kernel.org Subject: Umount fails for NFS mounts with "users" or "user" options Message-ID: <20210508030034.GA30593@marvin.atrad.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-MIMEDefang-action: accept X-Scanned-By: MIMEDefang 2.79 on 192.168.0.1 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi all When /etc/mtab is a symlink to /proc/mounts, users are still able to mount NFS volumes listed in /etc/fstab with the "user" or "users" option. However, attempting to unmount the same volume fails: umount.nfs: You are not permitted to unmount The /etc/fstab entry is nfssvr:/home/export /home/export nfs users,noauto,hard,bg,intr The kernel doesn't track the "user" or "users" options so they don't appear in /proc/mounts, and thus in /etc/mtab when the latter is a link to the former. However, when /etc/mtab is an ordinary file nfs.mount adds the "user" or "users" option to the entry (fix_opts_string() in utils/mount/mount.c) so the flag is available when /etc/mtab is consulted at unmount time. The util-linux mount tools must track the "user" and "users" options in their own way since mounts which use those tools with these flags work fine. I haven't quite determined where it does this: I thought it might be /run/mount/utab, but that file isn't created on my system (Slackware64 /current) and yet user mounts still generally work. What is the recommended way to unmount NFS volumes which are permitted to be mounted by users via the "user" and "users" options? The only way I can think of is a very careful sudo entry. It would be good though if nfs unmount could work with the "user" and "users" options just like mount does. Regards jonathan