diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2016-11-30 17:44:29 -0500 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2017-01-03 05:42:40 -0800 |
commit | 369fa575a1089b472c39a3843c56f694e1f7ad6f (patch) | |
tree | 5f0ca2dd5a23386d9df8e16f25bfd44a14fbc157 /xlators/storage | |
parent | 76fff8cb2a164b596ca67e65c99623f5b68361fd (diff) |
storage/posix: log the error when locking the export directory fails
posix xlator tries to prevent external unmount of the brick export directory
by locking it. It locks the export directory by opening it (i.e. doing a opendir).
But if opendir fails it errors out resulting in the brick process going down. The
error due to which opendir failed is not logged.
Change-Id: I28648382b7f0b88fb1aeb36152e5ab5d812374c9
BUG: 1401095
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/16018
Smoke: Gluster Build System <jenkins@build.gluster.org>
Tested-by: Vijay Bellur <vbellur@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 7abd2955fbb..36626a49745 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -6814,6 +6814,7 @@ init (xlator_t *this) gf_boolean_t tmp_bool = 0; int ret = 0; int op_ret = -1; + int op_errno = 0; ssize_t size = -1; uuid_t old_uuid = {0,}; uuid_t dict_uuid = {0,}; @@ -7169,8 +7170,11 @@ init (xlator_t *this) _private->mount_lock = sys_opendir (dir_data->data); if (!_private->mount_lock) { ret = -1; - gf_msg (this->name, GF_LOG_ERROR, 0, P_MSG_DIR_OPERATION_FAILED, - "Could not lock brick directory"); + op_errno = errno; + gf_msg (this->name, GF_LOG_ERROR, 0, + P_MSG_DIR_OPERATION_FAILED, + "Could not lock brick directory (%s)", + strerror (op_errno)); goto out; } #ifndef GF_DARWIN_HOST_OS |