X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Flhsmtool_posix.c;h=67f057909c0be9d49bab11549c0841955898ada0;hb=2112ccb3c4;hp=01e0fa0d1fa68ffd9fd6a535689b61b96d455f83;hpb=71a4616b38e81d021a65ee5305b692b271ed0955;p=fs%2Flustre-release.git diff --git a/lustre/utils/lhsmtool_posix.c b/lustre/utils/lhsmtool_posix.c index 01e0fa0..67f0579 100644 --- a/lustre/utils/lhsmtool_posix.c +++ b/lustre/utils/lhsmtool_posix.c @@ -851,22 +851,22 @@ static int ct_copy_xattr(const char *src, const char *dst, int src_fd, static int ct_path_lustre(char *buf, int sz, const char *mnt, const struct lu_fid *fid) { - return snprintf(buf, sz, "%s/%s/fid/"DFID_NOBRACE, mnt, - dot_lustre_name, PFID(fid)); + return scnprintf(buf, sz, "%s/%s/fid/"DFID_NOBRACE, mnt, + dot_lustre_name, PFID(fid)); } static int ct_path_archive(char *buf, int sz, const char *archive_dir, const struct lu_fid *fid) { - return snprintf(buf, sz, "%s/%04x/%04x/%04x/%04x/%04x/%04x/" - DFID_NOBRACE, archive_dir, - (fid)->f_oid & 0xFFFF, - (fid)->f_oid >> 16 & 0xFFFF, - (unsigned int)((fid)->f_seq & 0xFFFF), - (unsigned int)((fid)->f_seq >> 16 & 0xFFFF), - (unsigned int)((fid)->f_seq >> 32 & 0xFFFF), - (unsigned int)((fid)->f_seq >> 48 & 0xFFFF), - PFID(fid)); + return scnprintf(buf, sz, "%s/%04x/%04x/%04x/%04x/%04x/%04x/" + DFID_NOBRACE, archive_dir, + (fid)->f_oid & 0xFFFF, + (fid)->f_oid >> 16 & 0xFFFF, + (unsigned int)((fid)->f_seq & 0xFFFF), + (unsigned int)((fid)->f_seq >> 16 & 0xFFFF), + (unsigned int)((fid)->f_seq >> 32 & 0xFFFF), + (unsigned int)((fid)->f_seq >> 48 & 0xFFFF), + PFID(fid)); } static bool ct_is_retryable(int err)