[1/3] btrfs-progs: fi usage: change warning message more appropriately
diff mbox

Message ID e7316023-a809-4f88-b36a-749ffd9dac01@jp.fujitsu.com
State New
Headers show

Commit Message

Misono Tomohiro Nov. 30, 2017, 7:52 a.m. UTC
"fi usage" shows the warning "RAID5/6 numbers will be incorrect" when
runnning without root privilege even if raid5/6 is not used.  What
happens is it cannot get the per device profile usage info, so change
the message more appropriately.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
 cmds-fi-usage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Qu Wenruo Nov. 30, 2017, 7:59 a.m. UTC | #1
On 2017年11月30日 15:52, Misono, Tomohiro wrote:
> "fi usage" shows the warning "RAID5/6 numbers will be incorrect" when
> runnning without root privilege even if raid5/6 is not used.  What
> happens is it cannot get the per device profile usage info, so change
> the message more appropriately.
> 
> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
> ---
>  cmds-fi-usage.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c
> index 6c846c15..299c2dae 100644
> --- a/cmds-fi-usage.c
> +++ b/cmds-fi-usage.c
> @@ -590,7 +590,8 @@ int load_chunk_and_device_info(int fd, struct chunk_info **chunkinfo,
>  	ret = load_chunk_info(fd, chunkinfo, chunkcount);
>  	if (ret == -EPERM) {
>  		warning(
> -"cannot read detailed chunk info, RAID5/6 numbers will be incorrect, run as root");
> +		"cannot read detailed chunk info. " \
> +		"per device profile usage will not be shown, run as root");

IIRC it's allowed for long string to cross 80 chars limit.
This will make later grep easier.

And there is no need to indent the long string.

Thanks,
Qu
>  	} else if (ret) {
>  		return ret;
>  	}
>
Misono Tomohiro Nov. 30, 2017, 8:28 a.m. UTC | #2
On 2017/11/30 16:59, Qu Wenruo wrote:
> 
> 
> On 2017年11月30日 15:52, Misono, Tomohiro wrote:
>> "fi usage" shows the warning "RAID5/6 numbers will be incorrect" when
>> runnning without root privilege even if raid5/6 is not used.  What
>> happens is it cannot get the per device profile usage info, so change
>> the message more appropriately.
>>
>> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
>> ---
>>  cmds-fi-usage.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c
>> index 6c846c15..299c2dae 100644
>> --- a/cmds-fi-usage.c
>> +++ b/cmds-fi-usage.c
>> @@ -590,7 +590,8 @@ int load_chunk_and_device_info(int fd, struct chunk_info **chunkinfo,
>>  	ret = load_chunk_info(fd, chunkinfo, chunkcount);
>>  	if (ret == -EPERM) {
>>  		warning(
>> -"cannot read detailed chunk info, RAID5/6 numbers will be incorrect, run as root");
>> +		"cannot read detailed chunk info. " \
>> +		"per device profile usage will not be shown, run as root");
> 
> IIRC it's allowed for long string to cross 80 chars limit.
> This will make later grep easier.
> 
> And there is no need to indent the long string.
> 

Thanks, I will fix that.
Tomohiro

> Thanks,
> Qu
>>  	} else if (ret) {
>>  		return ret;
>>  	}
>>
> 

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

Patch
diff mbox

diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c
index 6c846c15..299c2dae 100644
--- a/cmds-fi-usage.c
+++ b/cmds-fi-usage.c
@@ -590,7 +590,8 @@  int load_chunk_and_device_info(int fd, struct chunk_info **chunkinfo,
 	ret = load_chunk_info(fd, chunkinfo, chunkcount);
 	if (ret == -EPERM) {
 		warning(
-"cannot read detailed chunk info, RAID5/6 numbers will be incorrect, run as root");
+		"cannot read detailed chunk info. " \
+		"per device profile usage will not be shown, run as root");
 	} else if (ret) {
 		return ret;
 	}