s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offline
authorMichael Adam <obnox@samba.org>
Thu, 3 Jul 2014 08:10:11 +0000 (10:10 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 7 Aug 2014 14:43:09 +0000 (16:43 +0200)
There is a problem of flapping offline due to uninitialized
stat buffers. Due to a optimization in vfswrap_readdir which
directly calling fastatat (i.e. not through vfs), marking the
stat buffer valid, there is nothing this module can do about
it and hence can not currently not rely on the vaildity of
the stat buffer.

By always calling out to GPFS even when the stat buffer is
flagged valid, we can always return correct offline information,
thereby sacrificing the readdir optimization.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
(cherry picked from commit 31e67507144aae8d5a8ec49587ac89d2d94636f0)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10741

source3/modules/vfs_gpfs.c

index ca8f80deb43607daf1f0003b8cacb9cef367af4a..614c56d91773e79393e65ff68fe37d8259fc08c5 100644 (file)
@@ -1652,9 +1652,7 @@ static bool vfs_gpfs_is_offline(struct vfs_handle_struct *handle,
                return -1;
        }
 
-       if (VALID_STAT(*sbuf)) {
-               attrs.winAttrs = sbuf->vfs_private;
-       } else {
+       {
                int ret;
                ret = get_gpfs_winattrs(path, &attrs);