From f3e68fff6e112ff6681ff2327c36d873aa3586b2 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Wed, 15 May 2019 18:19:06 +0200 Subject: [PATCH] client: fix "ceph.snap.btime" 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: https://tracker.ceph.com/issues/39705 Signed-off-by: David Disseldorp (cherry picked from commit 02935988ec61f67fb8203982fa259402c6e545af) --- src/client/Client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 92a53f5894251..e9ca2ce1ff2d4 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -11804,7 +11804,7 @@ bool Client::_vxattrcb_snap_btime_exists(Inode *in) size_t Client::_vxattrcb_snap_btime(Inode *in, char *val, size_t size) { - return snprintf(val, size, "%llu.09%lu", + return snprintf(val, size, "%llu.%09lu", (long long unsigned)in->snap_btime.sec(), (long unsigned)in->snap_btime.nsec()); } -- 2.47.3