diff options
| -rw-r--r-- | tests/bugs/bug-860297.t | 13 | ||||
| -rw-r--r-- | xlators/storage/posix/src/posix.c | 11 | 
2 files changed, 17 insertions, 7 deletions
diff --git a/tests/bugs/bug-860297.t b/tests/bugs/bug-860297.t new file mode 100644 index 00000000000..2a3ca7a7a6c --- /dev/null +++ b/tests/bugs/bug-860297.t @@ -0,0 +1,13 @@ +#!/bin/bash +. $(dirname $0)/../include.rc +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info +TEST $CLI volume create $V0 $H0:$B0/brick1 +setfattr -x trusted.glusterfs.volume-id $B0/brick1 +## If Extended attribute trusted.glusterfs.volume-id is not present +## then volume should not be able to start +TEST ! $CLI volume start $V0; +cleanup; diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 812bfda7dfb..cf4e086633b 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -4158,16 +4158,13 @@ init (xlator_t *this)                                  goto out;                          }                  } else if ((size == -1) && (errno == ENODATA)) { -                        /* Using the export for first time */ -                        size = sys_lsetxattr (dir_data->data, -                                                "trusted.glusterfs.volume-id", -                                                dict_uuid, 16, 0); -                        if (size == -1) { +                                  gf_log (this->name, GF_LOG_ERROR, -                                        "failed to set volume id on export"); +                                        "Extended attribute trusted.glusterfs." +                                        "volume-id is absent");                                  ret = -1;                                  goto out; -                        } +                  }  else if ((size == -1) && (errno != ENODATA)) {                          /* Wrong 'volume-id' is set, it should be error */                          gf_log (this->name, GF_LOG_WARNING,  | 
