Bug 10741 - VFS gpfs offline bit is flapping
Summary: VFS gpfs offline bit is flapping
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.1.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-24 12:42 UTC by Michael Adam
Modified: 2014-09-01 19:19 UTC (History)
2 users (show)

See Also:


Attachments
complete patchset for 4.1 (15.74 KB, patch)
2014-07-24 13:00 UTC, Michael Adam
cs: review+
obnox: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Adam 2014-07-24 12:42:41 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.
Comment 1 Michael Adam 2014-07-24 12:49:07 UTC
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.
Comment 2 Michael Adam 2014-07-24 13:00:39 UTC
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.
Comment 3 Michael Adam 2014-07-25 19:13:58 UTC
Assigning to Karolin for inclusion into 4.1.NEXT
Comment 4 Karolin Seeger 2014-08-03 18:39:55 UTC
Pushed to autobuild-v4-1-test.
Comment 5 Karolin Seeger 2014-09-01 19:19:01 UTC
(In reply to comment #4)
> Pushed to autobuild-v4-1-test.

Pushed to v4-1-test.
Closing out bug report.

Thanks!