I noticed a typo. I've changed one occurrence of 19 bytes to 29 bytes.
Since I claimed it would be easy to switch to VFS from PROXY, I tried
it. Switching from PROXY to VFS was easy but it seems to change the
behavior slightly. (e.g. The initial VFS directory listing/viewing shows
adjusted sizes.) To see the behavior exactly as I described, stick with
the NULL derived layer over the PROXY layer.
On 12/22/2016 10:07 AM, Kevin C. wrote:
To reduce the size of this email, the attached tgz file contains a
patch to the existing FSAL NULL rather than creating my FSAL NULL
derived layer.
Here is some additional information I believe to be relevant.
1. I believe the adjusted directory entries are correctly cached
before nfs4_readdir_callback() calls fsal_status =
obj->obj_ops.test_access().
2. mdcache_is_attrs_valid() returns false because "flags |=
MDCACHE_TRUST_ATTRS;" is executed and that causes
"((entry->mde_flags & flags) != flags)" to be false.
3. mdcache_test_access() calls fsal_test_access() and the
fsal_test_access() obj_hdl->obj_ops.getattrs() call skips over the
NULL derived layer and goes to the PROXY getattrs().
4. I've also attached a gdb debug log that might provide additional
useful info
1. Near the top of the log, it shows that pxy_readdir() was
called by my NULL derived layer.
2. Below mdcache_test_access() is where the NULL derived layer is
being ignored and unadjusted attributes get saved in the cache.
3. I haven't yet traced why the NULL derived layer is ignored
when reading (if the directory is listed/viewed before the read).
I believe it would be easy to stack over VFS but I'm trying to keep my
testing as realistic as possible so I'm stacking my NULL derived layer
over PROXY.
I suggest you populate your bottom (e.g. PROXY or VFS) file system
with the attached 1.txt file so that you don't need to do any writes
(and afterwards flush caches or restart). Through the NULL derived
layer, the file size is shown as 29 bytes. The NULL derived test layer
is inserting 32 bytes every 256 bytes. If you "cat" 1.txt before
listing/viewing the directory, the NULL derived layer is not bypassed
and the read data is as expected. If you ls 1.txt after reading the
file but before listing the directory or "cat *", the adjusted size is
listed.
This is prototype (proof of concept) code so it isn't yet optimized or
realistic processing.
If I truly understood the layering, I might already understand how to
stop ignoring the NULL derived layer below the mdcache_test_access()
calls. I'll continue to learn as I get more time to work with NFS-Ganesha.
Thanks for taking a look.
Kevin
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel