Adds the RGW-NFS library to the radosgw build, with unit tests.
Adds -fPIC to compile flags to satisfy the linker, but should have
been evident to automake/libtool.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
The current behavior of put_data_and_throttle leads to data
curruption, because the supplied buffer is apparently still being
written when the call returns--regardless of the value of
need_to_wait.
For now, do a buffer::copy of the supplied buffer, rather than the
original buffer::static, since that will at least be released
when no longer needed.
Probably this improves apparent rgw_write performance, but is not
what was originally intended.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
In hindsight, it seems clear how to consume the available bytes and
account for the bytes written into the caller's buffer.
Verified by unit test on data from S3, with a 6M file read in 1M
chunks, the preferred max read in modern Linux kernel NFS.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Move internal unlink logic into new RGWLibFS::unlink method, fix
logic for files and directories.
Use RGWFileHandle::mtx and RGWFileHandle::FLAG_DELETED to ensure
atomicity of handle creates and deletes.
Remove handles for unlinked objects from cache.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
In the rgw_create regular file case, the timestamp and size update
logic (though present) was being bypassed because the "FLAG_CREATE"
indicator which formerly propagated up from RGWLibFS::lookup_fh
was lost in the LRU change, which refactored the code for creating
new RGWFileHandle objects.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Save a pointer to CephContext in RGWProcess for use by logger--
using the existing pointer in ThreadPool would be an intrusive
change.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
The lack of stat here induced a serious memory corruption, due to
the organization of Ganesha file attributes (and their reliance on
the FSAL to initialize the memory).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Fix boilerplate to sanitize relative_object_name() in rgw_create
as well as the RGWStatObjRequest case of RGWLibFS::stat_leaf.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
The fix for missing bucket.creation_time in RGWStatBucket is not
complete--we're not carrying all the info over.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
This happens commonly, apparently when a parent object name ends
with '/' (as all explicit directories do).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Rewrite rgw_getattr to just dispatch into RGWLibFS::getattr, where
we can better use RGWFileHandle and RGWLibFS internals.
Initially, this change intended to dispatch a new RGWStatObjRequest
in the file case, but during implementation, discovered that in
(apparently) all file cases, it has already been done--but the path
had stopped working with the naming change.
Current GETATTR_DIRS1 unit test, when repeated so relying on lookup
(rather than saving size after rgw_write/rgw_close), passes.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Re-implement rgw_getattr to just dispatch into RGWFileHandle::stat,
we expect all objects to stat correctly for their type.
The size of file objects is currently reporting as 0, where we expect
a small, positive size (reviewing).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
rgw_create hadn't been re-implemented for NFS namespace behavior,
where we expect it to create empty file objects.
It needs to do a full name conflict check with prefix-matching,
to catch conflicts within object names.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Fixes handle type after rgw_mkdir.
Add handle type checks to nfsns unit tests. Adds tests to create
files and directories with non-bucket parent.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Adds method to RGWStatBucketRequest to access the creation_time of
the returned bucket.
(For now, that's the only timestamp we have.)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Fix the error returns from rgw_unlink. This is sufficient to
catch the errors that arise from operation failure.
We won't notice attempts to remove interior directories--and for
various reasons, that may be problematic (skip for now).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Split the transiently-creating concept (CREATING) from the request
to create objects used in lookup_fh.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Ganesha traditionally does not expect them, but they may be needed
when bypassing the MDCACHE (2.4).
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
New logic propagates is_truncated traveral-finished indicator up
from bucket and object list operations in all cases, and correctly
expands relative paths.
Unit test output looks promising.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Successfully creates 5*1024 objects at /nfsroot/nfs_marker/, verifies
externally.
Follow-up rgw_readdir shows 999 results, apparently the initial readdir
segment works correctly, but restart from offset fails.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>