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: v10.2.7~5^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c02ee4fe9ae70f30328a7b015f5cac4a1804c67;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 (cherry picked from commit b5f70ef7b066f9ff44770cc8a50ccadaa02f4691) --- diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index d9fc942159d0..8fb093010270 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -477,7 +477,7 @@ namespace rgw { bool deleted() const { return flags & FLAG_DELETED; } bool stateless_open() const { return flags & FLAG_STATELESS_OPEN; } - 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) { @@ -486,7 +486,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,