[Patch] mount: check if mtab is writable

Steve Dickson SteveD at redhat.com
Tue Jul 15 15:29:36 EDT 2008



Christiaan Welvaart wrote:
> Chuck Lever wrote:
>> On Jun 23, 2008, at 12:38 PM, Steve Dickson wrote:
>>> Chuck Lever wrote:
>>>> On Jun 23, 2008, at 9:40 AM, Steve Dickson wrote:
>>>>> I believe this patch would hide the fact (by not logging an
>>>>> error) that the mtab is not writeable plus mtab_is_writable()
>>>>> already called in the REMOUNT path...
>>>>>
>>>>> So unless there is a compelling reason I'm missing to apply
>>>>> this patch, I think we should take a pass on it...
>>>> There are plenty of unremarkable cases where /etc/mtab will not be
>>>> writable; for example, if /etc/mtab is replaced with a symlink to
>>>> /proc/mounts.  The tradition of mount (whether one agrees with it or
>>>> not) is to be silent in cases like this.
>>> hmm... is there any objection to break this tradition? I've never be a
>>> fan on making the user guess as to what the problem is...
>>
>> It's also probably worth looking at the latest util-linux to see how /
>> sbin/mount handles this case these days.
> 
> The latest util-linux-ng has exactly this check in update_mtab_entry().
> Since this function is equivalent to nfs-utils add_mtab() the check can
> indeed be moved to add_mtab(). But then it would be best to update this
> function with the code from util-linux-ng which means adding a separate
> create_mtab() .
> 
> See attached patch for an example of what this would look like.
Committed... 

steved.


More information about the NFSv4 mailing list