]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw_file: fix non-negative return code for open operation
authorGui Hecheng <guihecheng@cmss.chinamobile.com>
Mon, 20 Mar 2017 02:53:46 +0000 (10:53 +0800)
committerGui Hecheng <guihecheng@cmss.chinamobile.com>
Mon, 20 Mar 2017 02:53:46 +0000 (10:53 +0800)
The nfs-ganesha expects a negative retcode for errors.

Signed-off-by: Gui Hecheng <guihecheng@cmss.chinamobile.com>
src/rgw/rgw_file.h

index 15f25573c5870f6c574a054d720e449ea698df4b..c8fa490c967991d6d5faf2abe2f4c7ac2176aa7f 100644 (file)
@@ -486,7 +486,7 @@ namespace rgw {
     bool stateless_open() const { return flags & FLAG_STATELESS_OPEN; }
     bool has_children() const;
 
-    uint32_t open(uint32_t gsh_flags) {
+    int open(uint32_t gsh_flags) {
       lock_guard guard(mtx);
       if (! (flags & FLAG_OPEN)) {
        if (gsh_flags & RGW_OPEN_FLAG_V3) {
@@ -495,7 +495,7 @@ namespace rgw {
        flags |= FLAG_OPEN;
        return 0;
       }
-      return EPERM;
+      return -EPERM;
     }
 
     int readdir(rgw_readdir_cb rcb, void *cb_arg, uint64_t *offset, bool *eof,