summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1f55f2a)
This patch reverts commit
3917e62018878dfffac59ceed70f20b0419945d3,
which cannot handle the upgrade situation that old mountdata already
contains comma-separated NIDs. The correct way to fix the original
issue is to parse comma-separated NIDs in lmd_parse().
The patch also updates disk2_4-ldiskfs.tar.bz2 to make the mountdata
of ost contain comma-separated NIDs so as to verify the patch under
upgrade situation.
Test-Parameters: alwaysuploadlogs \
envdefinitions=SLOW=yes,ENABLE_QUOTA=yes testlist=conf-sanity
Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: If179618c9c89dc2168f748aeba59384ea31197ff
Reviewed-on: http://review.whamcloud.com/8918
Tested-by: Maloo <hpdd-maloo@intel.com>
Tested-by: Jenkins
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
*/
static int lmd_parse(char *options, struct lustre_mount_data *lmd)
{
*/
static int lmd_parse(char *options, struct lustre_mount_data *lmd)
{
- char *s1, *s2, *devname = NULL;
+ char *s1, *s2, *s3, *devname = NULL;
struct lustre_mount_data *raw = (struct lustre_mount_data *)options;
int rc = 0;
ENTRY;
struct lustre_mount_data *raw = (struct lustre_mount_data *)options;
int rc = 0;
ENTRY;
/* Skip whitespace and extra commas */
while (*s1 == ' ' || *s1 == ',')
s1++;
/* Skip whitespace and extra commas */
while (*s1 == ' ' || *s1 == ',')
s1++;
/* Client options are parsed in ll_options: eg. flock,
user_xattr, acl */
/* Client options are parsed in ll_options: eg. flock,
user_xattr, acl */
rc = lmd_parse_mgs(lmd, &s2);
if (rc)
goto invalid;
rc = lmd_parse_mgs(lmd, &s2);
if (rc)
goto invalid;
clear++;
} else if (strncmp(s1, "writeconf", 9) == 0) {
lmd->lmd_flags |= LMD_FLG_WRITECONF;
clear++;
} else if (strncmp(s1, "writeconf", 9) == 0) {
lmd->lmd_flags |= LMD_FLG_WRITECONF;
} else if (strncmp(s1, "param=", 6) == 0) {
int length;
char *tail = strchr(s1 + 6, ',');
} else if (strncmp(s1, "param=", 6) == 0) {
int length;
char *tail = strchr(s1 + 6, ',');
- else
- length = tail - s1;
+ } else {
+ lnet_nid_t nid;
+ char *param_str = tail + 1;
+ int supplementary = 1;
+
+ while (class_parse_nid_quiet(param_str, &nid,
+ ¶m_str) == 0) {
+ supplementary = 0;
+ }
+ length = param_str - s1 - supplementary;
+ }
length -= 6;
strncat(lmd->lmd_params, s1 + 6, length);
strcat(lmd->lmd_params, " ");
length -= 6;
strncat(lmd->lmd_params, s1 + 6, length);
strcat(lmd->lmd_params, " ");
clear++;
} else if (strncmp(s1, "osd=", 4) == 0) {
rc = lmd_parse_string(&lmd->lmd_osd_type, s1 + 4);
clear++;
} else if (strncmp(s1, "osd=", 4) == 0) {
rc = lmd_parse_string(&lmd->lmd_osd_type, s1 + 4);
- /* Find next opt */
- s2 = strchr(s1, ',');
+ /* Find next opt */
+ s2 = strchr(s3, ',');
if (s2 == NULL) {
if (clear)
*s1 = '\0';
if (s2 == NULL) {
if (clear)
*s1 = '\0';
count=$(($T32_BLIMIT / 1024 / 2))
chown $T32_QID.$T32_QID $tmp/src/t32_qf_old
count=$(($T32_BLIMIT / 1024 / 2))
chown $T32_QID.$T32_QID $tmp/src/t32_qf_old
+ # format ost with comma-separated NIDs to verify LU-4460
+ local failnid="$(h2$NETTYPE 1.2.3.4),$(h2$NETTYPE 4.3.2.1)"
+ MGSNID="$MGSNID,$MGSNID" OSTOPT="--failnode=$failnid" formatall
int add_param(char *buf, char *key, char *val)
{
int add_param(char *buf, char *key, char *val)
{
- char *sub_val = NULL;
- int buflen = strlen(buf);
- int end = sizeof(((struct lustre_disk_data *)0)->ldd_params);
- int start = 0;
- int keylen = 0;
+ int end = sizeof(((struct lustre_disk_data *)0)->ldd_params);
+ int start = strlen(buf);
+ int keylen = 0;
-
- start = buflen;
- while ((sub_val = strsep(&val, ",")) != NULL) {
- if (*sub_val == 0)
- continue;
-
- if (start + 1 + keylen + strlen(sub_val) >= end) {
- fprintf(stderr, "%s: params are too long-\n%s %s%s\n",
- progname, buf, key != NULL ? key : "", sub_val);
- buf[buflen] = '\0';
- return 1;
- }
-
- sprintf(buf + start, " %s%s", key != NULL ? key : "", sub_val);
- start = strlen(buf);
+ if (start + 1 + keylen + strlen(val) >= end) {
+ fprintf(stderr, "%s: params are too long-\n%s %s%s\n",
+ progname, buf, key ? key : "", val);
+ return 1;
+ sprintf(buf + start, " %s%s", key ? key : "", val);