Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw nfs v3 completions #10745

Merged
merged 9 commits into from Aug 30, 2016
Merged

rgw nfs v3 completions #10745

merged 9 commits into from Aug 30, 2016

Conversation

mattbenjamin
Copy link
Contributor

No description provided.

Allow passing POSIX open flags as well as api call flags.  Needed
for NFS3 support.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Allow passing POSIX open flags as well as api call flags.  Needed
for NFS3 support.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
@@ -220,9 +221,10 @@ int rgw_truncate(struct rgw_fs *rgw_fs,
*/
#define RGW_OPEN_FLAG_NONE 0x0000
#define RGW_OPEN_FLAG_CREATE 0x0001
#define RGW_OPEN_FLAG_V3 0x0002 /* ops have v3 semantics */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"V3" is not hugely meaningful to anyone not doing NFS work. Maybe "STATELESS"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used that elsewhere, so could do that.

@tchaikov tchaikov added the rgw label Aug 17, 2016
if (! (flags & FLAG_LOCKED)) {
guard.lock();
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad style. A unique_lock is the lock and flag all in one, if the function expects to be called with the lock both locked and not locked, it should take a unique_lock by reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really want a unique_lock propagating out to rgw_* callers

@adamemerson
Copy link
Contributor

Looks pretty good so far, apart from the one locking thing.

@mattbenjamin mattbenjamin changed the title [DNM] rgw nfs v3 completions rgw nfs v3 completions Aug 17, 2016
Implements a temporal mechanism to enforce write completion for setups
which lack open state tracking (e.g., NFS3).

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
@mattbenjamin
Copy link
Contributor Author

Removed an empty branch and bogus WS from the main commit.

@mattbenjamin
Copy link
Contributor Author

It appears this doesn't need a rebase, and is isolated.

struct rgw_file_handle **fh, uint32_t flags);
const char *name, struct stat *st, uint32_t mask,
struct rgw_file_handle **fh, uint32_t posix_flags,
uint32_t flags);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need some kind of versioning for changes to this public api?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think a #define would be sufficient?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

This change borrows the major, minor+extra format used by libcephfs.
The version numbering is starting at 1,1,0 on the theory that the
implicit version at Jewel is 1,0,0.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>

int commit(uint64_t offset, uint64_t length, uint32_t flags) {
return 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a stub for later? we might want to return ENOTSUPP for now, instead of returning success while there could still be unstable writes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't. If you give NFS3ERR_NOTSUPP in response to COMMIT you'll make the kernel freak out and probably record an item in non-volatile memory to remind itself not to talk to that server again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, atm, I'm just passing this result up through ganesha, which would have the result adam describes; we -could- return ENOTSUP here if we strongly prefer it, but then the rgw fsal would need to translate it to this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

This change replaces the existing member-hook typedef as well as
the new set-type typedefs, so committed separately.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Add a comment explaining why the method currently returns 0
unconditionally.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
@cbodley cbodley merged commit 97ca0fa into ceph:master Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants