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-4694 hsm: Cleanup codes about return value
[fs/lustre-release.git]
/
lustre
/
utils
/
lhsmtool_posix.c
diff --git
a/lustre/utils/lhsmtool_posix.c
b/lustre/utils/lhsmtool_posix.c
index
31e5486
..
2e18351
100644
(file)
--- a/
lustre/utils/lhsmtool_posix.c
+++ b/
lustre/utils/lhsmtool_posix.c
@@
-488,8
+488,8
@@
static int ct_restore_stripe(const char *src, const char *dst, int dst_fd,
rc = fsetxattr(dst_fd, XATTR_LUSTRE_LOV, lovea, lovea_size,
XATTR_CREATE);
if (rc < 0) {
rc = fsetxattr(dst_fd, XATTR_LUSTRE_LOV, lovea, lovea_size,
XATTR_CREATE);
if (rc < 0) {
- CT_ERROR(errno, "cannot set lov EA on '%s'", dst);
rc = -errno;
rc = -errno;
+ CT_ERROR(rc, "cannot set lov EA on '%s'", dst);
}
return rc;
}
return rc;
@@
-880,7
+880,7
@@
static int ct_archive(const struct hsm_action_item *hai, const long hal_flags)
src_fd = llapi_hsm_action_get_fd(hcp);
if (src_fd < 0) {
src_fd = llapi_hsm_action_get_fd(hcp);
if (src_fd < 0) {
- rc =
-errno
;
+ rc =
src_fd
;
CT_ERROR(rc, "cannot open '%s' for read", src);
goto fini_major;
}
CT_ERROR(rc, "cannot open '%s' for read", src);
goto fini_major;
}
@@
-1139,6
+1139,11
@@
static int ct_restore(const struct hsm_action_item *hai, const long hal_flags)
}
dst_fd = llapi_hsm_action_get_fd(hcp);
}
dst_fd = llapi_hsm_action_get_fd(hcp);
+ if (dst_fd < 0) {
+ rc = dst_fd;
+ CT_ERROR(rc, "cannot open '%s' for write", dst);
+ goto fini;
+ }
if (set_lovea) {
/* the layout cannot be allocated through .fid so we have to
if (set_lovea) {
/* the layout cannot be allocated through .fid so we have to