From b5f70ef7b066f9ff44770cc8a50ccadaa02f4691 Mon Sep 17 00:00:00 2001 From: Gui Hecheng Date: Mon, 20 Mar 2017 10:53:46 +0800 Subject: [PATCH] rgw_file: fix non-negative return code for open operation The nfs-ganesha expects a negative retcode for errors. Signed-off-by: Gui Hecheng --- src/rgw/rgw_file.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 15f25573c5870..c8fa490c96799 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,