Skip to content

Commit

Permalink
rgw_file: fix non-negative return code for open operation
Browse files Browse the repository at this point in the history
The nfs-ganesha expects a negative retcode for errors.

Signed-off-by: Gui Hecheng <guihecheng@cmss.chinamobile.com>
  • Loading branch information
Gui Hecheng committed Mar 20, 2017
1 parent 2beb4ee commit b5f70ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rgw/rgw_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit b5f70ef

Please sign in to comment.