From: David Disseldorp Date: Wed, 15 May 2019 14:56:39 +0000 (+0200) Subject: ceph: fix "ceph.dir.rctime" vxattr value X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=718807289d4130be1fe13f24f018733116958070;p=openwrt%2Fstaging%2Fblogic.git ceph: fix "ceph.dir.rctime" vxattr value The vxattr value incorrectly places a "09" prefix to the nanoseconds field, instead of providing it as a zero-pad width specifier after '%'. Fixes: 3489b42a72a4 ("ceph: fix three bugs, two in ceph_vxattrcb_file_layout()") Link: https://tracker.ceph.com/issues/39943 Signed-off-by: David Disseldorp Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 57350e4b7da0..d2fb9f10720c 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -224,7 +224,7 @@ static size_t ceph_vxattrcb_dir_rbytes(struct ceph_inode_info *ci, char *val, static size_t ceph_vxattrcb_dir_rctime(struct ceph_inode_info *ci, char *val, size_t size) { - return snprintf(val, size, "%lld.09%ld", ci->i_rctime.tv_sec, + return snprintf(val, size, "%lld.%09ld", ci->i_rctime.tv_sec, ci->i_rctime.tv_nsec); }