summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-helpers.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2017-07-06 16:39:37 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-07-13 08:09:56 +0000
commit73b2b7fe57069eb85485465fb92c52a97d4d411c (patch)
treef159f2f7d051f836a4cfd076072bb6602fcda03f /xlators/storage/posix/src/posix-helpers.c
parent0d75e39834d4880dce0cb3c79bef4b70bb32874d (diff)
storage/posix: Handle [f]xattrop xdata
Updates #251 Change-Id: I13d89c3b5dc39aa0a232a70be8ec6b64394cfa6e Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: https://review.gluster.org/17740 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 85005e07b14..649107d8cac 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -680,6 +680,7 @@ posix_pstat (xlator_t *this, uuid_t gfid, const char *path,
struct stat lstatbuf = {0, };
struct iatt stbuf = {0, };
int ret = 0;
+ int op_errno = 0;
struct posix_private *priv = NULL;
@@ -691,22 +692,12 @@ posix_pstat (xlator_t *this, uuid_t gfid, const char *path,
posix_fill_gfid_path (this, path, &stbuf);
ret = sys_lstat (path, &lstatbuf);
-
- if (ret != 0) {
- if (ret == -1) {
- if (errno != ENOENT)
- gf_msg (this->name, GF_LOG_WARNING, errno,
- P_MSG_LSTAT_FAILED,
- "lstat failed on %s",
- path);
- } else {
- // may be some backend filesytem issue
- gf_msg (this->name, GF_LOG_ERROR, 0, P_MSG_LSTAT_FAILED,
- "lstat failed on %s and return value is %d "
- "instead of -1. Please see dmesg output to "
- "check whether the failure is due to backend "
- "filesystem issue", path, ret);
- ret = -1;
+ if (ret == -1) {
+ if (errno != ENOENT) {
+ op_errno = errno;
+ gf_msg (this->name, GF_LOG_WARNING, errno,
+ P_MSG_LSTAT_FAILED, "lstat failed on %s", path);
+ errno = op_errno;/*gf_msg could have changed errno*/
}
goto out;
}