Patchwork [1/2] ext4: MMP: kmmpd should use nodename from init_uts_ns.name, not sysname

login
register
mail settings
Submitter Nikitas Angelinas
Date Sept. 23, 2011, 12:23 a.m.
Message ID <1316737389-5522-2-git-send-email-nikitas_angelinas@xyratex.com>
Download mbox | patch
Permalink /patch/116021/
State Superseded
Headers show

Comments

Nikitas Angelinas - Sept. 23, 2011, 12:23 a.m.
sysname holds "Linux" by default, i.e. what appears when doing a "uname
-s"; nodename should be used to print the machine's hostname, i.e. what
is returned when doing a "uname -n" or "hostname", and what
gethostname(2)/sethostname(2) manipulate, in order to notify the
administrator of the node which is contending to mount the filesystem.

Signed-off-by: Nikitas Angelinas <nikitas_angelinas@xyratex.com>
Signed-off-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
---
 fs/ext4/mmp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Andrew Perepechko - Sept. 23, 2011, 8:24 a.m.
Hello Nikitas!

It looks like some bits of your patches somehow got dropped.

Andrew

On 09/23/2011 04:23 AM, Nikitas Angelinas wrote:
> sysname holds "Linux" by default, i.e. what appears when doing a "uname
> -s"; nodename should be used to print the machine's hostname, i.e. what
> is returned when doing a "uname -n" or "hostname", and what
> gethostname(2)/sethostname(2) manipulate, in order to notify the
> administrator of the node which is contending to mount the filesystem.
>
> Signed-off-by: Nikitas Angelinas<nikitas_angelinas@xyratex.com>
> Signed-off-by: Andrew Perepechko<andrew_perepechko@xyratex.com>
> ---
>   fs/ext4/mmp.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
> index 9bdef3f..2fca64e 100644
> --- a/fs/ext4/mmp.c
> +++ b/fs/ext4/mmp.c
> @@ -109,7 +109,7 @@ static int kmmpd(void *data)
>   	mmp->mmp_check_interval = cpu_to_le16(mmp_check_interval);
>   	bdevname(bh->b_bdev, mmp->mmp_bdevname);
>
> -	memcpy(mmp->mmp_nodename, init_utsname()->sysname,
> +	memcpy(mmp->mmp_nodename, init_utsname()->nodename,
>   	       sizeof(mmp->mmp_nodename));
>
>   	while (!kthread_should_stop()) {
Andrew Perepechko - Sept. 23, 2011, 11:30 a.m.
Never mind, they are not relevant.

Andrew

On 09/23/2011 12:24 PM, Andrew Perepechko wrote:
> Hello Nikitas!
>
> It looks like some bits of your patches somehow got dropped.
>
> Andrew
>
> On 09/23/2011 04:23 AM, Nikitas Angelinas wrote:
>> sysname holds "Linux" by default, i.e. what appears when doing a "uname
>> -s"; nodename should be used to print the machine's hostname, i.e. what
>> is returned when doing a "uname -n" or "hostname", and what
>> gethostname(2)/sethostname(2) manipulate, in order to notify the
>> administrator of the node which is contending to mount the filesystem.
>>
>> Signed-off-by: Nikitas Angelinas<nikitas_angelinas@xyratex.com>
>> Signed-off-by: Andrew Perepechko<andrew_perepechko@xyratex.com>
>> ---
>>   fs/ext4/mmp.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
>> index 9bdef3f..2fca64e 100644
>> --- a/fs/ext4/mmp.c
>> +++ b/fs/ext4/mmp.c
>> @@ -109,7 +109,7 @@ static int kmmpd(void *data)
>>       mmp->mmp_check_interval = cpu_to_le16(mmp_check_interval);
>>       bdevname(bh->b_bdev, mmp->mmp_bdevname);
>>
>> -    memcpy(mmp->mmp_nodename, init_utsname()->sysname,
>> +    memcpy(mmp->mmp_nodename, init_utsname()->nodename,
>>              sizeof(mmp->mmp_nodename));
>>
>>       while (!kthread_should_stop()) {
>
Andreas Dilger - Sept. 23, 2011, 6:51 p.m.
On 2011-09-22, at 6:23 PM, Nikitas Angelinas wrote:
> sysname holds "Linux" by default, i.e. what appears when doing a "uname
> -s"; nodename should be used to print the machine's hostname, i.e. what
> is returned when doing a "uname -n" or "hostname", and what
> gethostname(2)/sethostname(2) manipulate, in order to notify the
> administrator of the node which is contending to mount the filesystem.
> 
> Signed-off-by: Nikitas Angelinas <nikitas_angelinas@xyratex.com>
> Signed-off-by: Andrew Perepechko <andrew_perepechko@xyratex.com>

This looks to have crept in with the port of the patch to RHEL6, which
required the code to stop accessing system_utsname directly and instead
using the init_utsname() helper to access the structure.  That version
of the patch was contributed by an external developer, so I can't really
say why it was done, probably just an oversight.  In our RHEL5 patch it
used to be:

       memcpy(mmp->mmp_nodename, system_utsname.nodename,
              sizeof(mmp->mmp_nodename));

You can add Acked-by: Andreas Dilger <adilger@dilger.ca>.

Thanks for the fix.

> ---
> fs/ext4/mmp.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
> index 9bdef3f..2fca64e 100644
> --- a/fs/ext4/mmp.c
> +++ b/fs/ext4/mmp.c
> @@ -109,7 +109,7 @@ static int kmmpd(void *data)
> 	mmp->mmp_check_interval = cpu_to_le16(mmp_check_interval);
> 	bdevname(bh->b_bdev, mmp->mmp_bdevname);
> 
> -	memcpy(mmp->mmp_nodename, init_utsname()->sysname,
> +	memcpy(mmp->mmp_nodename, init_utsname()->nodename,
> 	       sizeof(mmp->mmp_nodename));
> 
> 	while (!kthread_should_stop()) {
> -- 
> 1.7.4.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers, Andreas





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

Patch

diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index 9bdef3f..2fca64e 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -109,7 +109,7 @@  static int kmmpd(void *data)
 	mmp->mmp_check_interval = cpu_to_le16(mmp_check_interval);
 	bdevname(bh->b_bdev, mmp->mmp_bdevname);
 
-	memcpy(mmp->mmp_nodename, init_utsname()->sysname,
+	memcpy(mmp->mmp_nodename, init_utsname()->nodename,
 	       sizeof(mmp->mmp_nodename));
 
 	while (!kthread_should_stop()) {