[LU-960] Bad stripe count reported by lfs getstripe when default stripe count set to -1 Created: 04/Jan/12  Updated: 27/Mar/12  Resolved: 27/Mar/12

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.2.0
Fix Version/s: Lustre 2.2.0, Lustre 2.1.2

Type: Bug Priority: Minor
Reporter: Johann Lombardi (Inactive) Assignee: Minh Diep
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 4762

 Description   

When using a default stripe count of -1, the stripe count reported for newly created directory is bogus. Here is how to reproduce:

[root@client-4 tests]# export STRIPES_PER_OBJ=-1
[root@client-4 tests]# sh ./llmount.sh
[...]
[root@client-4 tests]# lfs getstripe -d /mnt/lustre
stripe_count:   -1 stripe_size:    1048576 stripe_offset:  -1
[root@client-4 tests]# mkdir /mnt/lustre/foo
[root@client-4 tests]# lfs getstripe -d /mnt/lustre/foo
stripe_count:   4294967295 stripe_size:    1048576 stripe_offset:  -1
                ^^^^^^^^^^


 Comments   
Comment by Johann Lombardi (Inactive) [ 04/Jan/12 ]

In fact the problem lies in lov_dump_user_lmm_header():

static void lov_dump_user_lmm_header(...)
[...]
        if (verbose & VERBOSE_COUNT) {
                if (verbose & ~VERBOSE_COUNT)
                        llapi_printf(LLAPI_MSG_NORMAL, "%sstripe_count:   ",
                                     prefix);
                if (is_dir) {
                        if (!raw && lum->lmm_stripe_count == 0) {
                                unsigned int scount;
                                rc = sattr_cache_get_defaults(NULL, path,
                                                              &scount, NULL,
                                                              NULL);
                                if (rc == 0)
                                        llapi_printf(LLAPI_MSG_NORMAL, "%u%c",
!!!!!!                                                                  ^^ This must be %d here
                                                     scount, nl);
                                else
                                        llapi_error(LLAPI_MSG_ERROR, rc,
                                                    "Cannot determine default"
                                                    " stripe count.");
                        } else {
                                llapi_printf(LLAPI_MSG_NORMAL, "%d%c",
                                             lum->lmm_stripe_count ==
                                             (typeof(lum->lmm_stripe_count))(-1)
                                             ? -1 : lum->lmm_stripe_count, nl);
                        }
                } else {
                        llapi_printf(LLAPI_MSG_NORMAL, "%hd%c",
                                     (__s16)lum->lmm_stripe_count, nl);
                }
Comment by Peter Jones [ 04/Jan/12 ]

Minh

YangSheng is busy atm so could you please look into this one?

Thanks

Peter

Comment by Minh Diep [ 05/Jan/12 ]

indeed, that fixed the problem.

[root@client-6 tests]# export STRIPES_PER_OBJ=-1
[root@client-6 tests]# sh ./llmount.sh
...

[root@client-6 utils]# ./lfs getstripe -d /mnt/lustre
stripe_count: -1 stripe_size: 1048576 stripe_offset: -1
[root@client-6 utils]# mkdir /mnt/lustre/foo
[root@client-6 utils]# ./lfs getstripe -d /mnt/lustre/foo
stripe_count: -1 stripe_size: 1048576 stripe_offset: -1

I'll post a patch soon

Comment by Minh Diep [ 05/Jan/12 ]

patch http://review.whamcloud.com/#change,1922

I also fixed the case where lfs setstripe -s -1

[root@client-6 utils]# lfs setstripe -s -1 /mnt/lustre/foo
error: bad stripe_size 18446744073709551615, must be an even multiple of 65536 bytes: Invalid argument (22)
error: setstripe: create stripe file '/mnt/lustre/foo' failed

after fix

[root@client-6 utils]# ./lfs setstripe -s -1 /mnt/lustre/foo
error: setstripe: bad size '-1'
[root@client-6 utils]#

Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » x86_64,client,el6,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » x86_64,server,el5,ofa #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » i686,server,el6,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » x86_64,client,el5,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » x86_64,client,el5,ofa #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » x86_64,client,sles11,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » x86_64,server,el6,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » i686,client,el6,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » x86_64,server,el5,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » x86_64,client,ubuntu1004,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » i686,server,el5,ofa #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » i686,server,el5,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » i686,client,el5,inkernel #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Build Master (Inactive) [ 19/Jan/12 ]

Integrated in lustre-master » i686,client,el5,ofa #432
LU-960 utils: bad stripe count report, and validate stripe size (Revision c42ad03831f4c564c8125f42a18ae7d700d6a3f5)

Result = SUCCESS
Oleg Drokin : c42ad03831f4c564c8125f42a18ae7d700d6a3f5
Files :

  • lustre/utils/liblustreapi.c
Comment by Minh Diep [ 07/Feb/12 ]

patch for b2_1 http://review.whamcloud.com/#change,2112

Generated at Sat Feb 10 01:12:08 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.