Skip to content
Snippets Groups Projects
Commit fbf12730 authored by Bobi Jam's avatar Bobi Jam
Browse files

Branch b1_6

b=12836
i=adilger, komaln

Description: lfs find on -1 stripe looping in lsm_lmm_verify_common()
Details    : Avoid lov_verify_lmm_common() on directory with -1 stripe count.
parent 9b808186
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,11 @@ Bugzilla : 12743 ...@@ -36,6 +36,11 @@ Bugzilla : 12743
Description: df doesn't work properly if diskfs blocksize != 4K Description: df doesn't work properly if diskfs blocksize != 4K
Details : Choose biggest blocksize of OST's as the LOV's blocksize. Details : Choose biggest blocksize of OST's as the LOV's blocksize.
Severity : normal
Bugzilla : 12836
Description: lfs find on -1 stripe looping in lsm_lmm_verify_common()
Details : Avoid lov_verify_lmm_common() on directory with -1 stripe count.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
2007-08-27 Cluster File Systems, Inc. <info@clusterfs.com> 2007-08-27 Cluster File Systems, Inc. <info@clusterfs.com>
......
...@@ -70,7 +70,9 @@ static int lsm_lmm_verify_common(struct lov_mds_md *lmm, int lmm_bytes, ...@@ -70,7 +70,9 @@ static int lsm_lmm_verify_common(struct lov_mds_md *lmm, int lmm_bytes,
} }
if (lmm->lmm_stripe_size == 0 || if (lmm->lmm_stripe_size == 0 ||
(__u64)le32_to_cpu(lmm->lmm_stripe_size)*stripe_count > 0xffffffff){ (stripe_count != -1 &&
(__u64)le32_to_cpu(lmm->lmm_stripe_size)*stripe_count >
0xffffffff)) {
CERROR("bad stripe size %u\n", CERROR("bad stripe size %u\n",
le32_to_cpu(lmm->lmm_stripe_size)); le32_to_cpu(lmm->lmm_stripe_size));
lov_dump_lmm_v1(D_WARNING, lmm); lov_dump_lmm_v1(D_WARNING, lmm);
......
...@@ -49,7 +49,7 @@ void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm) ...@@ -49,7 +49,7 @@ void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm)
le32_to_cpu(lmm->lmm_stripe_size), le32_to_cpu(lmm->lmm_stripe_size),
le32_to_cpu(lmm->lmm_stripe_count)); le32_to_cpu(lmm->lmm_stripe_count));
for (i = 0, lod = lmm->lmm_objects; for (i = 0, lod = lmm->lmm_objects;
i < le32_to_cpu(lmm->lmm_stripe_count); i++, lod++) i < (int)le32_to_cpu(lmm->lmm_stripe_count); i++, lod++)
CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n", CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n",
i, le32_to_cpu(lod->l_ost_idx), i, le32_to_cpu(lod->l_ost_idx),
le64_to_cpu(lod->l_object_gr), le64_to_cpu(lod->l_object_gr),
......
...@@ -2762,6 +2762,13 @@ test_65k() { # bug11679 ...@@ -2762,6 +2762,13 @@ test_65k() { # bug11679
} }
run_test 65k "validate manual striping works properly with deactivated OSCs" run_test 65k "validate manual striping works properly with deactivated OSCs"
test_65l() { # bug 12836
mkdir -p $DIR/$tdir
$LFS setstripe $DIR/$tdir 65536 -1 -1
$LFS find -mtime -1 $DIR
}
run_test 65l "lfs find on -1 stipe dir ========================"
# bug 2543 - update blocks count on client # bug 2543 - update blocks count on client
test_66() { test_66() {
COUNT=${COUNT:-8} COUNT=${COUNT:-8}
......
...@@ -785,7 +785,8 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, void *data) ...@@ -785,7 +785,8 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, void *data)
decision = -1; decision = -1;
/* If a OST UUID is given, and some OST matches, check it here. */ /* If a OST UUID is given, and some OST matches, check it here. */
if (decision != -1 && param->obdindex != OBD_NOT_FOUND) { if (decision != -1 && param->obdindex != OBD_NOT_FOUND &&
S_ISREG(st->st_mode)) {
/* Only those files should be accepted, which have a strip on /* Only those files should be accepted, which have a strip on
* the specified OST. */ * the specified OST. */
if (!param->lmd->lmd_lmm.lmm_stripe_count) { if (!param->lmd->lmd_lmm.lmm_stripe_count) {
...@@ -808,14 +809,17 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, void *data) ...@@ -808,14 +809,17 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, void *data)
if (!decision) { if (!decision) {
int for_mds; int for_mds;
for_mds = lustre_fs ? param->lmd->lmd_lmm.lmm_stripe_count : 0; for_mds = lustre_fs ? (S_ISREG(st->st_mode) &&
param->lmd->lmd_lmm.lmm_stripe_count)
: 0;
decision = find_time_check(st, param, for_mds); decision = find_time_check(st, param, for_mds);
} }
/* If file still fits the request, ask osd for updated info. /* If file still fits the request, ask osd for updated info.
The regulat stat is almost of the same speed as some new The regulat stat is almost of the same speed as some new
'glimpse-size-ioctl'. */ 'glimpse-size-ioctl'. */
if (!decision && param->lmd->lmd_lmm.lmm_stripe_count) { if (!decision && param->lmd->lmd_lmm.lmm_stripe_count &&
S_ISREG(st->st_mode)) {
if (dir) { if (dir) {
ret = ioctl(dirfd(dir), IOC_LOV_GETINFO, ret = ioctl(dirfd(dir), IOC_LOV_GETINFO,
(void *)param->lmd); (void *)param->lmd);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment