summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorGaurav Kumar Garg <ggarg@redhat.com>2015-06-01 14:35:57 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-08-24 23:09:20 -0700
commitedcf4d35397a0a4843b3f6b107c44630c86f3d3c (patch)
tree7532c73407a4d509f63b1d2d88dd91457b0c269d /libglusterfs
parentd7adcca24fb9638df2806c01d8ea7e73eec46928 (diff)
libglusterfs: write error handling when filesystem have no space left
When no space left on filesystem and user want to perform any operation which result to change in /var/lib/glusterd/* files then glusterd is failing to write on temporary file. Fix is to handle error when write failed on temporary files due to no space left on file system. Change-Id: I79d595776b42580da35e1282b4a3cd7fe3d14afe BUG: 1253148 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/11029 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Cedric Buissart (cherry picked from commit e7f737e62a9ea9eac730b6ba3ef8739e497e1540) Reviewed-on: http://review.gluster.org/11902 Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/store.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libglusterfs/src/store.c b/libglusterfs/src/store.c
index 08479776c96..3da82a4768d 100644
--- a/libglusterfs/src/store.c
+++ b/libglusterfs/src/store.c
@@ -344,15 +344,15 @@ gf_store_save_value (int fd, char *key, char *value)
fp = fdopen (dup_fd, "a+");
if (fp == NULL) {
- gf_msg ("", GF_LOG_WARNING, errno, LG_MSG_FILE_OP_FAILED, "fdopen "
- "failed.");
+ gf_msg (THIS->name, GF_LOG_WARNING, errno,
+ LG_MSG_FILE_OP_FAILED, "fdopen failed.");
ret = -1;
goto out;
}
ret = fprintf (fp, "%s=%s\n", key, value);
if (ret < 0) {
- gf_msg ("", GF_LOG_WARNING, errno, LG_MSG_FILE_OP_FAILED,
+ gf_msg (THIS->name, GF_LOG_WARNING, errno, LG_MSG_FILE_OP_FAILED,
"Unable to store key: %s, value: %s.",
key, value);
ret = -1;
@@ -360,8 +360,8 @@ gf_store_save_value (int fd, char *key, char *value)
}
ret = fflush (fp);
- if (feof (fp)) {
- gf_msg ("", GF_LOG_WARNING, errno, LG_MSG_FILE_OP_FAILED,
+ if (ret) {
+ gf_msg (THIS->name, GF_LOG_WARNING, errno, LG_MSG_FILE_OP_FAILED,
"fflush failed.");
ret = -1;
goto out;
@@ -372,7 +372,7 @@ out:
if (fp)
fclose (fp);
- gf_msg_debug ("", 0, "returning: %d", ret);
+ gf_msg_debug (THIS->name, 0, "returning: %d", ret);
return ret;
}