]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: explicit NFSv3 open() emulation 18365/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 17 Oct 2017 21:45:37 +0000 (17:45 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 17 Oct 2017 21:45:37 +0000 (17:45 -0400)
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 <mbenjamin@redhat.com>
src/rgw/rgw_file.cc

index 3a3edf382bcf04f0e6f952c70c5d79c4842fc05d..4ef9901281c5bf4b529f26035c76ff805a3e1ded 100644 (file)
@@ -1943,8 +1943,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);