[Ocfs2-tools-devel] [PATCH 1/1] ocfs2-tools: mount not showing fully resolved path

Srinivas Eeda srinivas.eeda at oracle.com
Tue Nov 24 20:17:43 PST 2015


On 11/24/2015 06:32 PM, Gang He wrote:
> The fix looks good, just one more question,
> did you really encounter any problem here before? thanks.
yes, df shows

/dev/dm-8 /poolfsmnt/0004fb000005000029cc46d987e2897a ocfs2 
rw,_netdev,heartbeat=global 0 0

instead of

/dev/mapper/<name> /poolfsmnt/0004fb000005000029cc46d987e2897a ocfs2 
rw,_netdev,heartbeat=global 0 0

>
> Reviewed-by: Gang He <ghe at suse.com>
>
>
>> On 11/25/2015 05:05 AM, Srinivas Eeda wrote:
>>> In /etc/mtab, device path is not fully resolved because fgets return code
>>> checked incorrectly. Device path is getting set to /dev/dm-X instead of
>>> /dev/mapper/xxx.
>>>
>>> Orabug: 22264767
>>>
>>> Signed-off-by: Srinivas Eeda <srinivas.eeda at oracle.com>
>> Looks good.
>>
>> Reviewed-by: Junxiao Bi <junxiao.bi at oracle.com>
>>> ---
>>>   mount.ocfs2/sundries.c | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/mount.ocfs2/sundries.c b/mount.ocfs2/sundries.c
>>> index 2e1b95a..c4e9ccd 100644
>>> --- a/mount.ocfs2/sundries.c
>>> +++ b/mount.ocfs2/sundries.c
>>> @@ -235,7 +235,7 @@ canonicalize_dm_name(const char *ptname)
>>>   	FILE	*f;
>>>   	size_t	sz;
>>>   	char	path[256], name[256], *res = NULL;
>>> -	int	err;
>>> +	char	*ret;
>>>   
>>>   	snprintf(path, sizeof(path), "/sys/block/%s/dm/name", ptname);
>>>   	f = fopen(path, "r");
>>> @@ -243,9 +243,9 @@ canonicalize_dm_name(const char *ptname)
>>>   		return NULL;
>>>   
>>>   	/* read "<name>\n" from sysfs */
>>> -	err = fgets(name, sizeof(name), f);
>>> +	ret = fgets(name, sizeof(name), f);
>>>   	sz = strlen(name);
>>> -	if (!err && sz > 1) {
>>> +	if (ret && sz > 1) {
>>>   		name[sz - 1] = '\0';
>>>   		snprintf(path, sizeof(path), "/dev/mapper/%s", name);
>>>   		res = strdup(path);
>>>
>>
>> _______________________________________________
>> Ocfs2-tools-devel mailing list
>> Ocfs2-tools-devel at oss.oracle.com
>> https://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel




More information about the Ocfs2-tools-devel mailing list