Skip to content
Snippets Groups Projects
Commit 0ed515c2 authored by Liu Ying's avatar Liu Ying
Browse files

Branch HEAD

b=12333
i=green, nathan

Description: obdclass is limited by single OBD_ALLOC(idarray)
Details    : replace OBD_ALLOC/OBD_FREE with OBD_VMALLOC/OBD_VFREE
parent 30e383fa
No related merge requests found
...@@ -330,14 +330,16 @@ int llog_cat_initialize(struct obd_device *obd, struct obd_llogs *llogs, ...@@ -330,14 +330,16 @@ int llog_cat_initialize(struct obd_device *obd, struct obd_llogs *llogs,
int count, struct obd_uuid *uuid) int count, struct obd_uuid *uuid)
{ {
char name[32] = CATLIST; char name[32] = CATLIST;
struct llog_catid *idarray; struct llog_catid *idarray = NULL;
int size = sizeof(*idarray) * count; int size = sizeof(*idarray) * count;
int rc; int rc;
ENTRY; ENTRY;
OBD_ALLOC(idarray, size); if (count) {
if (!idarray) OBD_VMALLOC(idarray, size);
RETURN(-ENOMEM); if (!idarray)
RETURN(-ENOMEM);
}
rc = llog_get_cat_list(obd, obd, name, count, idarray); rc = llog_get_cat_list(obd, obd, name, count, idarray);
if (rc) { if (rc) {
...@@ -358,7 +360,8 @@ int llog_cat_initialize(struct obd_device *obd, struct obd_llogs *llogs, ...@@ -358,7 +360,8 @@ int llog_cat_initialize(struct obd_device *obd, struct obd_llogs *llogs,
} }
out: out:
OBD_FREE(idarray, size); if (idarray)
OBD_VFREE(idarray, size);
RETURN(rc); RETURN(rc);
} }
EXPORT_SYMBOL(llog_cat_initialize); EXPORT_SYMBOL(llog_cat_initialize);
......
...@@ -1144,6 +1144,29 @@ test_32b() { ...@@ -1144,6 +1144,29 @@ test_32b() {
} }
run_test 32b "Upgrade from 1.4 with writeconf" run_test 32b "Upgrade from 1.4 with writeconf"
test_33() { # bug 12333
local FSNAME2=test1234
local fs2mds_HOST=$mds_HOST
local fs2ost_HOST=$ost_HOST
local fs2mdsdev=${MDSDEV}_2
local fs2ostdev=$(ostdevname 1)_2
add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=`hostname`@tcp --reformat $fs2ostdev || exit 10
start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
start fs2ost $fs2ostdev $OST_MOUNT_OPTS
mkdir -p $MOUNT2
mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
echo "ok."
umount -d $MOUNT2
stop fs2ost -f
stop fs2mds -f
rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev
cleanup_nocli || return 6
}
run_test 33 "Mount ost with a large index number"
umount_client $MOUNT umount_client $MOUNT
cleanup_nocli cleanup_nocli
cleanup_krb5_env cleanup_krb5_env
......
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