From 6231637eeef0998c224c9b23d52da1397476f0b6 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Tue, 27 Aug 2013 09:08:18 -0500 Subject: [PATCH] LU-3835 hsm: add missing braces to ct_copy_attr() Add missing braces to ct_copy_attr() in lhsmtool_posix.c so that we don't return a stale errno on success. Signed-off-by: John L. Hammond Change-Id: Ia8ab377d8fd00d94666b15713f4e749d1330854a Reviewed-on: http://review.whamcloud.com/7462 Tested-by: Hudson Reviewed-by: jacques-Charles Lafoucriere Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/utils/lhsmtool_posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/utils/lhsmtool_posix.c b/lustre/utils/lhsmtool_posix.c index c2b4df4..dd496f1 100644 --- a/lustre/utils/lhsmtool_posix.c +++ b/lustre/utils/lhsmtool_posix.c @@ -714,10 +714,12 @@ static int ct_copy_attr(const char *src, const char *dst, int src_fd, times[1].tv_usec = 0; if (fchmod(dst_fd, st.st_mode) < 0 || fchown(dst_fd, st.st_uid, st.st_gid) < 0 || - futimes(dst_fd, times) < 0) + futimes(dst_fd, times) < 0) { CT_ERROR("'%s' fchmod fchown or futimes failed (%s)\n", src, strerror(errno)); return -errno; + } + return 0; } -- 1.8.3.1