From: Matt Benjamin Date: Tue, 17 Oct 2017 21:45:37 +0000 (-0400) Subject: rgw_file: explicit NFSv3 open() emulation X-Git-Tag: v12.2.2~53^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e58656005d681ee0e35a25b324321cfeea8c7b3a;p=ceph.git rgw_file: explicit NFSv3 open() emulation Expect RGW_OPEN_FLAG_V3 in rgw_write(), and if present, attempt a stateless open inline. Required by Ganesha v2.5 and later Signed-off-by: Matt Benjamin (cherry picked from commit 6ed23b4a0cea7e41b4743e27319737af693947ec) --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index e941ece9269..96d934a90b4 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -1894,8 +1894,14 @@ int rgw_write(struct rgw_fs *rgw_fs, if (! rgw_fh->is_file()) return -EISDIR; - if (! rgw_fh->is_open()) - return -EPERM; + if (! rgw_fh->is_open()) { + if (flags & RGW_OPEN_FLAG_V3) { + rc = rgw_fh->open(flags); + if (!! rc) + return rc; + } else + return -EPERM; + } rc = rgw_fh->write(offset, length, bytes_written, buffer);