From: Gui Hecheng Date: Mon, 20 Mar 2017 02:53:46 +0000 (+0800) Subject: rgw_file: fix non-negative return code for open operation X-Git-Tag: v12.0.1~30^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14045%2Fhead;p=ceph.git rgw_file: fix non-negative return code for open operation The nfs-ganesha expects a negative retcode for errors. Signed-off-by: Gui Hecheng --- diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 15f25573c587..c8fa490c9679 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -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,