Re: [PATCH 2/2] mount: add --enable-libmount-mount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 03/04/2011 05:18 AM, Karel Zak wrote:
> On Thu, Mar 03, 2011 at 02:53:06PM -0500, Steve Dickson wrote:
>>> +	opts = retrieve_mount_options(mnt_context_get_fs(cxt));
>>> +
>>> +	if (!mnt_context_is_lazy(cxt)) {
>>> +		if (opts) {
>>> +			/* we have full FS description (e.g. from mtab or /proc) */
>>> +			switch (is_vers4(cxt)) {
>>> +			case 0:
>>> +				/* We ignore the error from nfs_umount23.
>>> +				 * If the actual umount succeeds (in del_mtab),
>>> +				 * we don't want to signal an error, as that
>>> +				 * could cause /sbin/mount to retry!
>>> +				 */
>>> +				nfs_umount23(mnt_context_get_source(cxt), opts);
>>> +				break;
>>> +			case 1:			/* unknown */
>>> +				break;
>>> +			default:		/* error */
>>> +				goto err;
>>> +			}
>>> +		} else
>>> +			/* strange, no entry in mtab or /proc not mounted */
>>> +			nfs_umount23(spec, "tcp,v3");
>> Question: since retrieve_mount_options() returns NULL why do you assume 
>> the mount exists?
> 
>  because on systems with /etc/mtab is possible that the file is empty,
>  so we have no clue about the mount point.
Ah... I am so glad mtab is going away! 

>  
>  This is normal umount(8) behavior, for root user it always tries to
>  call umount(2) syscall. We should not assume that there is usable
>  /proc or /etc/mtab. It's important be able to umount any device
>  independently on /proc or /etc.
> 
>  See nfsumount.c, the current code uses the same logic.
Got it..

> 
>> What's happing is I'm doing an umount.nfs on an 
>> not existing mount point and the error is 
>>     umount.nfs: remote share not in 'host:dir' format
>>
>> Instead of
>>     umount.nfs: /mnt/home: not mounted
> 
>  Good catch, this is bug. There is missing umount_error();
> 
>  I'll update the patch and add your change to mount_config_init() too.
Thank you...

steved.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux