Re: [PATCH 1/1] umount.nfs: normalize path names during umounts.

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

 




On 03/05/2012 04:30 PM, Malahal Naineni wrote:
> Malahal Naineni [malahal@xxxxxxxxxx] wrote:
>>>  		while (pmc->m.mnt_fsname[nlen - 1] == '/')
>>>  			nlen--;
>>> -		if (strncmp(pmc->m.mnt_fsname, mc->m.mnt_fsname, nlen) != 0)
>>> -			continue;
>>> +		/*
>>> +		 * When the mtab and /proc/mounts are not the same
>>> +		 * file, normalize the path in the mtab if needed.
>>> +		 */
>>> +		if (mtab_is_writable())
>>> +			normpath = normalize_path(mc->m.mnt_fsname);
>>> +
>>> +		if (strncmp(pmc->m.mnt_fsname, mc->m.mnt_fsname, nlen) != 0) {
>>> +			/* Is there a normalized path, if so compare that one too */
>>> +			if (normpath == NULL)
>>> +				continue;
>>> +			if (strncmp(pmc->m.mnt_fsname, normpath, nlen) != 0)
>>> +				continue;
>>
>> You need to free normpath here before the "continue".
> 
> Better yet, you don't need to normalize the path inside the loop. The
> path you normalize doesn't change, so keep it outside "do while" loop.
Your are right... 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