]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: explicit NFSv3 open() emulation 18446/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 17 Oct 2017 21:45:37 +0000 (17:45 -0400)
committerAbhishek Lekshmanan <abhishek@suse.com>
Fri, 20 Oct 2017 15:06:41 +0000 (17:06 +0200)
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>
(cherry picked from commit 6ed23b4a0cea7e41b4743e27319737af693947ec)

src/rgw/rgw_file.cc

index e941ece9269cb9f693ad3babb4e209f63739de3a..96d934a90b426fc2832ded0191d9bd50db9e2293 100644 (file)
@@ -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);