s3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in vfs_gpfs_fstat()

This may (e.g.) have lead to some occurrences of flapping offline bits.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offline

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>
s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offline

In is_offline(), check whether the winAttrs are filled with bits
outside 0xFFFF and log it prominently: Since GPFS only
fills 0xFFFF, this could be due to an uninitialized buffer
(or another vfs module filling vfs_private? ...).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
s3:smbd: initialize stat_ex buffer in smbd_dirptr_get_entry()

This prevents random garbage in the vfs_private member.
Usually it should not be a problem to leave initialization
of the vfs_private to the vfs module who wants to use it,
but further down in the directory listing code, in
vfswrap_readdir, there is in optimization introduced
with 2a65e8befef004fd18d17853a1b72155752346c8, to call
fstatat if possible to already fill stat info in the
readdir call.

The problem is that this calls fstatat directly,
not going through VFS, but still making the stat buffer
valid, leaving vfs_private with random garbage.
Hence a vfs module using vfs_private, like vfs_gpfs
does for offline info (and winAttrs in general)
does not have a chance to tell whether the vfs_private
is valid if the stat buffer is marked valid.
This is a reason for the "flapping offline flag" problem
of the vfs_gpfs module.

Initializing the vfs_private to 0 here will for the
vfs_gpfs module result in files being marked online
always in a directory listing. So this is not a real fix
but it does at least make the problem less random.

A real general fix might be to implement SMB_VFS_FSTATAT()
and use it here.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Sun Jul 13 11:26:58 CEST 2014 on sn-devel-104