The Samba-Bugzilla – Bug 10741
VFS gpfs offline bit is flapping
Last modified: 2014-09-01 19:19:01 UTC
The file offline information reported by the gpfs module is observed to be flapping randomly for each file, e.g. when hitting reload in the windows explorer.
This applies to cases configured with "store dos attributes = yes" and "gpfs:winattr = yes.
The reason for this is that the offline information is stored as a cache in the vfs_private member of struct stat_ex. Now access to this stat buffer is based upon VALID_STAT() and this can be set when no VFS-module has had a chance to fill vfs_private. For instance, the readdir implementation calls fstatat without going through the vfs. Combined with the fact that vfs_private was not initialized, this leads to the randomly oscillating offline status observed.
But even if the call to fstatat were fixed to go through VFS: the vfs_private is a broken concept since this may be used by all vfs modules.
The fix for the gpfs module is to not use the vfs_private cache for caching the offline info, but calling into gpfs always to retrieve the information.
Furthermore, the cache is used in a couple of places in the vfs_gpfs module, not only in the vfs_gpfs_is_offline() implementation, so these are places that need to be fixed as well, so that decisions can be made based upon correct data.
Created attachment 10151 [details]
complete patchset for 4.1
This is a complete patchset for 4.1.NEXT, cherry-picked from master.
It might be discussed to omit some patches, e.g.
the last small cleanup in vfs_gpfs_is_offline()
or the removal of vfs_private from struct stat_ex.
Assigning to Karolin for inclusion into 4.1.NEXT
Pushed to autobuild-v4-1-test.
(In reply to comment #4)
> Pushed to autobuild-v4-1-test.
Pushed to v4-1-test.
Closing out bug report.