Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-12999 mgs: Cleanup string handling in name_create_mdt
[fs/lustre-release.git]
/
lustre
/
mgs
/
mgs_llog.c
diff --git
a/lustre/mgs/mgs_llog.c
b/lustre/mgs/mgs_llog.c
index
841afcd
..
b9d8550
100644
(file)
--- a/
lustre/mgs/mgs_llog.c
+++ b/
lustre/mgs/mgs_llog.c
@@
-1534,12
+1534,15
@@
static int only_mgs_is_running(struct obd_device *mgs_obd)
return (num_devices <= 3) && (num_exports == 0);
}
return (num_devices <= 3) && (num_exports == 0);
}
-static int name_create_mdt(char **logname, char *fsname, int
i
)
+static int name_create_mdt(char **logname, char *fsname, int
mdt_idx
)
{
{
- char
mdt_inde
x[9];
+ char
postfi
x[9];
- sprintf(mdt_index, "-MDT%04x", i);
- return name_create(logname, fsname, mdt_index);
+ if (mdt_idx > INDEX_MAP_MAX_VALUE)
+ return -E2BIG;
+
+ snprintf(postfix, sizeof(postfix), "-MDT%04x", mdt_idx);
+ return name_create(logname, fsname, postfix);
}
/**
}
/**