summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAnkitRaj <anraj@redhat.com>2017-06-05 14:11:43 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-06-20 12:31:58 +0000
commitee9a2f01adb6c089f4579c5e0b7f5eed335dd0df (patch)
tree2f95b95e6cf9906542405882979eaa204f51b498 /xlators
parent426c2908aee4addd36d925ee93e56c9b2688ec1b (diff)
dht: passing the errno as an argument to gf_msg
There are many calls in gf_msg where errno is needed to pass as an argument instead of strerrno(error) Change-Id: I15048a5e0b41f9752a2023afe8470eca6f2cd383 Bug: 1454701 Signed-off-by: AnkitRaj <anraj@redhat.com> Reviewed-on: https://review.gluster.org/17464 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: MOHIT AGRAWAL <moagrawa@redhat.com> Reviewed-by: N Balachandran <nbalacha@redhat.com> Tested-by: N Balachandran <nbalacha@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Karthik U S <ksubrahm@redhat.com> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c219
1 files changed, 109 insertions, 110 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 669db2b84ba..17d3bd95ee0 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -360,7 +360,7 @@ gf_defrag_handle_hardlink (xlator_t *this, loc_t *loc, dict_t *xattrs,
ret = -2;
goto out;
}
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
"Migrate file failed:%s lookup failed with ret = %d",
loc->path, ret);
@@ -421,12 +421,12 @@ gf_defrag_handle_hardlink (xlator_t *this, loc_t *loc, dict_t *xattrs,
ret = syncop_setxattr (cached_subvol, loc, link_xattr, 0, NULL,
NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
"Migrate file failed :"
- "Linkto setxattr failed %s -> %s (%s)",
+ "Linkto setxattr failed %s -> %s",
cached_subvol->name,
- loc->name, strerror (-ret));
+ loc->name);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -666,10 +666,10 @@ __dht_rebalance_create_dst_file (xlator_t *this, xlator_t *to, xlator_t *from,
}
if ((ret < 0) && (-ret != ENOENT)) {
/* File exists in destination, but not accessible */
- gf_msg (THIS->name, GF_LOG_WARNING, 0,
+ gf_msg (THIS->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: failed to lookup file (%s)",
- loc->path, strerror (-ret));
+ "%s: failed to lookup file",
+ loc->path);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -735,9 +735,9 @@ __dht_rebalance_create_dst_file (xlator_t *this, xlator_t *to, xlator_t *from,
}
if (-ret == ENOENT) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED, "%s: file does not exists"
- "on %s (%s)", loc->path, to->name, strerror (-ret));
+ "on %s", loc->path, to->name);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -746,10 +746,10 @@ __dht_rebalance_create_dst_file (xlator_t *this, xlator_t *to, xlator_t *from,
ret = syncop_fsetxattr (to, fd, xattr, 0, NULL, NULL);
if (ret < 0) {
*fop_errno = -ret;
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: failed to set xattr on %s (%s)",
- loc->path, to->name, strerror (-ret));
+ "%s: failed to set xattr on %s",
+ loc->path, to->name);
}
@@ -759,10 +759,10 @@ __dht_rebalance_create_dst_file (xlator_t *this, xlator_t *to, xlator_t *from,
ret = syncop_ftruncate (to, fd, stbuf->ia_size, NULL, NULL);
if (ret < 0) {
*fop_errno = -ret;
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "ftruncate failed for %s on %s (%s)",
- loc->path, to->name, strerror (-ret));
+ "ftruncate failed for %s on %s",
+ loc->path, to->name);
*/
ret = syncop_fsetattr (to, fd, stbuf,
@@ -770,10 +770,10 @@ __dht_rebalance_create_dst_file (xlator_t *this, xlator_t *to, xlator_t *from,
NULL, NULL, NULL, NULL);
if (ret < 0) {
*fop_errno = -ret;
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "chown failed for %s on %s (%s)",
- loc->path, to->name, strerror (-ret));
+ "chown failed for %s on %s",
+ loc->path, to->name);
}
/* Fallocate does not work for size 0, hence the check. Anyway we don't
@@ -782,10 +782,10 @@ __dht_rebalance_create_dst_file (xlator_t *this, xlator_t *to, xlator_t *from,
ret = syncop_fallocate (to, fd, 0, 0, stbuf->ia_size, NULL,
NULL);
if (ret < 0) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "fallocate failed for %s on %s (%s)",
- loc->path, to->name, strerror (-ret));
+ "fallocate failed for %s on %s",
+ loc->path, to->name);
ret = -1;
goto out;
}
@@ -848,10 +848,10 @@ __dht_check_free_space (xlator_t *this, xlator_t *to, xlator_t *from, loc_t *loc
ret = syncop_statfs (from, loc, &src_statfs, xdata, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "failed to get statfs of %s on %s (%s)",
- loc->path, from->name, strerror (-ret));
+ "failed to get statfs of %s on %s",
+ loc->path, from->name);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -859,10 +859,10 @@ __dht_check_free_space (xlator_t *this, xlator_t *to, xlator_t *from, loc_t *loc
ret = syncop_statfs (to, loc, &dst_statfs, xdata, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "failed to get statfs of %s on %s (%s)",
- loc->path, to->name, strerror (-ret));
+ "failed to get statfs of %s on %s",
+ loc->path, to->name);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1095,10 +1095,10 @@ __dht_rebalance_open_src_file (xlator_t *this, xlator_t *from, xlator_t *to, loc
ret = syncop_open (from, loc, O_RDWR, fd, NULL, NULL);
if (ret < 0) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "failed to open file %s on %s (%s)",
- loc->path, from->name, strerror (-ret));
+ "failed to open file %s on %s",
+ loc->path, from->name);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1134,10 +1134,10 @@ __dht_rebalance_open_src_file (xlator_t *this, xlator_t *from, xlator_t *to, loc
to show which is the target, so other clients can work around it */
ret = syncop_setxattr (from, loc, dict, 0, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "failed to set xattr on %s in %s (%s)",
- loc->path, from->name, strerror (-ret));
+ "failed to set xattr on %s in %s",
+ loc->path, from->name);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1155,10 +1155,10 @@ __dht_rebalance_open_src_file (xlator_t *this, xlator_t *from, xlator_t *to, loc
ret = syncop_setattr (from, loc, &iatt, GF_SET_ATTR_MODE, NULL, NULL,
NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "failed to set mode on %s in %s (%s)",
- loc->path, from->name, strerror (-ret));
+ "failed to set mode on %s in %s",
+ loc->path, from->name);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1202,10 +1202,10 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,
/* check in the destination if the file is link file */
ret = syncop_lookup (to, loc, &stbuf, NULL, dict, &rsp_dict);
if ((ret < 0) && (-ret != ENOENT)) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: lookup failed (%s)",
- loc->path, strerror (-ret));
+ "%s: lookup failed",
+ loc->path);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1230,10 +1230,10 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,
/* as file is linkfile, delete it */
ret = syncop_unlink (to, loc, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: failed to delete the linkfile (%s)",
- loc->path, strerror (-ret));
+ "%s: failed to delete the linkfile",
+ loc->path);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1256,10 +1256,10 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,
ret = syncop_readlink (from, loc, &link, buf->ia_size, NULL,
NULL);
if (ret < 0) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: readlink on symlink failed (%s)",
- loc->path, strerror (-ret));
+ "%s: readlink on symlink failed",
+ loc->path);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1267,10 +1267,10 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,
ret = syncop_symlink (to, loc, link, 0, dict, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: creating symlink failed (%s)",
- loc->path, strerror (-ret));
+ "%s: creating symlink failed",
+ loc->path);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1284,10 +1284,10 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,
makedev (ia_major (buf->ia_rdev),
ia_minor (buf->ia_rdev)), 0, dict, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: mknod failed (%s)",
- loc->path, strerror (-ret));
+ "%s: mknod failed",
+ loc->path);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1299,20 +1299,20 @@ done:
GF_SET_ATTR_UID | GF_SET_ATTR_GID |
GF_SET_ATTR_MODE), NULL, NULL, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: failed to perform setattr on %s (%s)",
- loc->path, to->name, strerror (-ret));
+ "%s: failed to perform setattr on %s",
+ loc->path, to->name);
*fop_errno = -ret;
ret = -1;
}
ret = syncop_unlink (from, loc, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: unlink failed (%s)",
- loc->path, strerror (-ret));
+ "%s: unlink failed",
+ loc->path);
*fop_errno = -ret;
ret = -1;
}
@@ -1507,11 +1507,11 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
if (ret < 0) {
*fop_errno = -ret;
ret = -1;
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, *fop_errno,
DHT_MSG_MIGRATE_FILE_FAILED,
"migrate file failed: "
- "%s: failed to lock file on %s (%s)",
- loc->path, from->name, strerror (*fop_errno));
+ "%s: failed to lock file on %s",
+ loc->path, from->name);
goto out;
}
@@ -1522,11 +1522,11 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
if (ret) {
*fop_errno = -ret;
ret = -1;
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, *fop_errno,
DHT_MSG_MIGRATE_FILE_FAILED,
"Migrate file failed:"
- "%s: lookup failed on %s (%s)",
- loc->path, from->name, strerror (*fop_errno));
+ "%s: lookup failed on %s",
+ loc->path, from->name);
goto out;
}
@@ -1556,11 +1556,11 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
if (ret < 0) {
*fop_errno = -ret;
ret = -1;
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, *fop_errno,
DHT_MSG_MIGRATE_FILE_FAILED,
"Migrate file failed:"
- "%s: failed to get xattr from %s (%s)",
- loc->path, from->name, strerror (*fop_errno));
+ "%s: failed to get xattr from %s",
+ loc->path, from->name);
}
/* create the destination, with required modes/xattr */
@@ -1753,7 +1753,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
ret = syncop_setxattr (from, loc, meta_dict, 0, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
"Trace syncop_setxattr metalock failed");
@@ -1799,7 +1799,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
ret = syncop_setactivelk (to, loc, &locklist, NULL,
NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_LOCK_MIGRATION_FAILED,
"write lock failed on:%s", loc->path);
@@ -1808,7 +1808,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
goto metaunlock;
}
} else {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_LOCK_MIGRATION_FAILED,
"getactivelk failed for file: %s", loc->path);
*fop_errno = -ret;
@@ -1877,10 +1877,10 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
ret = syncop_setxattr (old_target, loc, dict, 0, NULL, NULL);
if (ret && -ret != ESTALE && -ret != ENOENT) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "failed to set xattr on %s in %s (%s)",
- loc->path, old_target->name, strerror (-ret));
+ "failed to set xattr on %s in %s",
+ loc->path, old_target->name);
*fop_errno = -ret;
ret = -1;
goto out;
@@ -1891,10 +1891,10 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
* as linkto xattr value*/
linkto_fd = fd_create (loc->inode, DHT_REBALANCE_PID);
if (!linkto_fd) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, errno,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: fd create failed (%s)",
- loc->path, strerror (errno));
+ "%s: fd create failed",
+ loc->path);
*fop_errno = ENOMEM;
ret = -1;
goto out;
@@ -1905,10 +1905,10 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
if (ret != 0 && -ret != EEXIST && -ret != ESTALE) {
*fop_errno = -ret;
ret = -1;
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "failed to create linkto file on %s in %s (%s)",
- loc->path, old_target->name, strerror (-ret));
+ "failed to create linkto file on %s in %s",
+ loc->path, old_target->name);
goto out;
} else if (ret == 0) {
ret = syncop_fsetattr (old_target, linkto_fd, &stbuf,
@@ -1916,10 +1916,10 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
NULL, NULL, NULL, NULL);
if (ret < 0)
*fop_errno = -ret;
- gf_msg (this->name, GF_LOG_ERROR, 0,
- DHT_MSG_MIGRATE_FILE_FAILED,
- "chown failed for %s on %s (%s)",
- loc->path, old_target->name, strerror (-ret));
+ gf_msg (this->name, GF_LOG_ERROR,
+ -ret, DHT_MSG_MIGRATE_FILE_FAILED,
+ "chown failed for %s on %s",
+ loc->path, old_target->name);
}
}
}
@@ -1939,11 +1939,11 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
ret = syncop_listxattr (from, loc, &xattr, NULL, NULL);
if (ret < 0) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
"Migrate file failed:"
- "%s: failed to get xattr from %s (%s)",
- loc->path, from->name, strerror (-ret));
+ "%s: failed to get xattr from %s",
+ loc->path, from->name);
*fop_errno = -ret;
ret = -1;
} else {
@@ -1952,11 +1952,11 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
/* Potential problem here where Posix ACLs will
* not be set on the target file */
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
"Migrate file failed:"
- "%s: failed to set xattr on %s (%s)",
- loc->path, to->name, strerror (-ret));
+ "%s: failed to set xattr on %s",
+ loc->path, to->name);
*fop_errno = -ret;
ret = -1;
}
@@ -2025,10 +2025,10 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
ret = syncop_stat (from, loc, &empty_iatt, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: failed to do a stat on %s (%s)",
- loc->path, from->name, strerror (-ret));
+ "%s: failed to do a stat on %s",
+ loc->path, from->name);
if (-ret != ENOENT) {
*fop_errno = -ret;
@@ -2045,10 +2045,10 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
/* take out the source from namespace */
ret = syncop_unlink (from, loc, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: failed to perform unlink on %s (%s)",
- loc->path, from->name, strerror (-ret));
+ "%s: failed to perform unlink on %s",
+ loc->path, from->name);
*fop_errno = -ret;
ret = -1;
goto metaunlock;
@@ -2057,9 +2057,9 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
ret = syncop_lookup (this, loc, NULL, NULL, NULL, NULL);
if (ret) {
- gf_msg_debug (this->name, 0,
- "%s: failed to lookup the file on subvolumes (%s)",
- loc->path, strerror (-ret));
+ gf_msg_debug (this->name, -ret,
+ "%s: failed to lookup the file on subvolumes",
+ loc->path);
*fop_errno = -ret;
ret = -1;
}
@@ -2105,7 +2105,7 @@ metaunlock:
ret = syncop_setxattr (from, loc, meta_dict, 0, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
"Trace syncop_setxattr meta unlock failed");
@@ -2146,10 +2146,10 @@ out:
lk_ret = syncop_inodelk (from, DHT_FILE_MIGRATE_DOMAIN,
&tmp_loc, F_SETLK, &flock, NULL, NULL);
if (lk_ret < 0) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -lk_ret,
DHT_MSG_MIGRATE_FILE_FAILED,
- "%s: failed to unlock file on %s (%s)",
- loc->path, from->name, strerror (-lk_ret));
+ "%s: failed to unlock file on %s",
+ loc->path, from->name);
}
}
@@ -2511,7 +2511,7 @@ gf_defrag_migrate_single_file (void *opaque)
ret = syncop_lookup (this, &entry_loc, &iatt, NULL, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_MIGRATE_FILE_FAILED,
"Migrate file failed: %s lookup failed",
entry_loc.path);
@@ -2611,10 +2611,9 @@ gf_defrag_migrate_single_file (void *opaque)
ret = gf_defrag_handle_migrate_error (fop_errno, defrag);
if (!ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
+ gf_msg(this->name, GF_LOG_ERROR, fop_errno,
DHT_MSG_MIGRATE_FILE_FAILED,
- "migrate-data on %s failed: %s", entry_loc.path,
- strerror (fop_errno));
+ "migrate-data on %s failed:", entry_loc.path);
} else if (ret == 1) {
ret = 0;
goto out;
@@ -3045,7 +3044,7 @@ gf_defrag_process_dir (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,
ret = syncop_opendir (this, loc, fd, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
+ gf_msg (this->name, GF_LOG_WARNING, -ret,
DHT_MSG_MIGRATE_DATA_FAILED,
"Migrate data failed: Failed to open dir %s",
loc->path);
@@ -3809,7 +3808,7 @@ gf_tier_do_fix_layout (void *args)
dht_build_root_loc (defrag->root_inode, &loc);
ret = syncop_lookup (this, &loc, &iatt, &parent, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_REBALANCE_START_FAILED,
"Lookup on root failed.");
ret = -1;
@@ -4042,7 +4041,7 @@ dht_get_local_subvols_and_nodeuuids (xlator_t *this, dht_conf_t *conf,
GF_REBAL_FIND_LOCAL_SUBVOL,
NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0, 0, "local "
+ gf_msg (this->name, GF_LOG_ERROR, -ret, 0, "local "
"subvolume determination failed with error: %d",
-ret);
ret = -1;
@@ -4109,7 +4108,7 @@ gf_defrag_start_crawl (void *data)
ret = syncop_lookup (this, &loc, &iatt, &parent, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_REBALANCE_START_FAILED,
"Failed to start rebalance: look up on / failed");
ret = -1;
@@ -4183,7 +4182,7 @@ gf_defrag_start_crawl (void *data)
ret = syncop_setxattr (this, &loc, fix_layout, 0, NULL, NULL);
if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
DHT_MSG_REBALANCE_FAILED,
"fix layout on %s failed",
loc.path);