gpfs vfs incorrectly returning offline status 'at random' in 3.6 and up
Barry Evans
bevans at canditmedia.co.uk
Fri Sep 28 09:52:34 MDT 2012
Thanks for the response Christian - much more info now. We stuck a few more debugs in vfs_gpfs.c around the vfs_gpfs_is_offline function, including some to spit out the reported winAttr (from where it's coming from):
(also - I was not initially recompiling before sending last night but I have been now)
static bool vfs_gpfs_is_offline(struct vfs_handle_struct *handle,
const struct smb_filename *fname,
SMB_STRUCT_STAT *sbuf)
{
struct gpfs_winattr attrs;
char *path = NULL;
NTSTATUS status;
status = get_full_smb_filename(talloc_tos(), fname, &path);
if (!NT_STATUS_IS_OK(status)) {
errno = map_errno_from_nt_status(status);
DEBUG(10, ("SHOWME 1\n"));
return -1;
}
if (VALID_STAT(*sbuf)) {
attrs.winAttrs = sbuf->vfs_private;
} else {
int ret;
ret = get_gpfs_winattrs(path, &attrs);
if (ret == -1) {
TALLOC_FREE(path);
DEBUG(10, ("SHOWME 2\n"));
return false;
}
}
if ((attrs.winAttrs & GPFS_WINATTR_OFFLINE) != 0) {
DEBUG(10, ("%s is offline\n", path));
TALLOC_FREE(path);
DEBUG(10, ("SHOWME gpfs_get_xattr:Got attributes: 0x%x\n",attrs.winAttrs));
DEBUG(10, ("SHOWME 3\n"));
return true;
}
DEBUG(10, ("%s is online\n", path));
TALLOC_FREE(path);
DEBUG(10, ("SHOWME gpfs_get_xattr:Got attributes: 0x%x\n",attrs.winAttrs));
DEBUG(10, ("SHOWME 4\n"));
return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
}
The result on "Got attributes" were strange - they seemed to be all over the place:
grep "Got attr" log.smbd
SHOWME gpfs_get_xattr:Got attributes: 0x1a8ea880
SHOWME gpfs_get_xattr:Got attributes: 0x1a8ec5c0
SHOWME gpfs_get_xattr:Got attributes: 0x1a8f0d40
SHOWME gpfs_get_xattr:Got attributes: 0x1a8bd710
SHOWME gpfs_get_xattr:Got attributes: 0x1a8ec280
SHOWME gpfs_get_xattr:Got attributes: 0x1a8e8800
SHOWME gpfs_get_xattr:Got attributes: 0x1a8b70d0
SHOWME gpfs_get_xattr:Got attributes: 0x1a8e5160
SHOWME gpfs_get_xattr:Got attributes: 0x1a8e9840
SHOWME gpfs_get_xattr:Got attributes: 0x1a8cdbd0
SHOWME gpfs_get_xattr:Got attributes: 0x1a8f3ac0
SHOWME gpfs_get_xattr:Got attributes: 0x1a8f0040
SHOWME gpfs_get_xattr:Got attributes: 0x1a8bb920
SHOWME gpfs_get_xattr:Got attributes: 0x1a8b5d50
SHOWME gpfs_get_xattr:Got attributes: 0x1a8f0a00
And indeed different for the same file:
excerpt on second run: SHOWME gpfs_get_xattr:Got attributes: 0x1a8bc9d0
excerpt on first run: SHOWME gpfs_get_xattr:Got attributes: 0xccaf0d70
full output on second run:
[2012/09/28 08:21:39.834382, 10] smbd/trans2.c:1944(smbd_marshall_dir_entry)
smbd_marshall_dir_entry: SMB_FIND_ID_BOTH_DIRECTORY_INFO
[2012/09/28 08:21:39.834412, 6] smbd/dir.c:969(smbd_dirptr_get_entry)
smbd_dirptr_get_entry: dirptr 0x7fdb1a88efb0 now at offset 268435609
[2012/09/28 08:21:39.834448, 8] smbd/dosmode.c:621(dos_mode)
dos_mode: test/test149.txt
[2012/09/28 08:21:39.834476, 8] smbd/dosmode.c:199(dos_mode_from_sbuf)
dos_mode_from_sbuf returning
[2012/09/28 08:21:39.834505, 10] modules/vfs_gpfs.c:1230(vfs_gpfs_is_offline)
test/test149.txt is offline
[2012/09/28 08:21:39.834532, 10] modules/vfs_gpfs.c:1232(vfs_gpfs_is_offline)
SHOWME gpfs_get_xattr:Got attributes: 0x1a8bc9d0
[2012/09/28 08:21:39.834559, 10] modules/vfs_gpfs.c:1233(vfs_gpfs_is_offline)
SHOWME 3
[2012/09/28 08:21:39.834586, 8] smbd/dosmode.c:672(dos_mode)
dos_mode returning
[2012/09/28 08:21:39.834617, 10] locking/locking.c:1026(fetch_share_mode_unlocked)
fetch_share_mode_unlocked: no share_mode record around (file not open)
[2012/09/28 08:21:39.834645, 3] smbd/dir.c:1041(smbd_dirptr_get_entry)
smbd_dirptr_get_entry mask=[*] found test/test149.txt fname=test149.txt (test149.txt)
[2012/09/28 08:21:39.834676, 10] smbd/trans2.c:1572(smbd_marshall_dir_entry)
smbd_marshall_dir_entry: space_remaining = 55192
[2012/09/28 08:21:39.834703, 10] smbd/trans2.c:1944(smbd_marshall_dir_entry)
full output on first run:
[2012/09/28 07:01:23.514592, 10] smbd/trans2.c:1944(smbd_marshall_dir_entry)
smbd_marshall_dir_entry: SMB_FIND_ID_BOTH_DIRECTORY_INFO
[2012/09/28 07:01:23.514620, 6] smbd/dir.c:969(smbd_dirptr_get_entry)
smbd_dirptr_get_entry: dirptr 0x7f9dccab07e0 now at offset 268435609
[2012/09/28 07:01:23.514654, 8] smbd/dosmode.c:621(dos_mode)
dos_mode: test/test149.txt
[2012/09/28 07:01:23.514681, 8] smbd/dosmode.c:199(dos_mode_from_sbuf)
dos_mode_from_sbuf returning
[2012/09/28 07:01:23.514707, 10] modules/vfs_gpfs.c:1230(vfs_gpfs_is_offline)
test/test149.txt is offline
[2012/09/28 07:01:23.514732, 10] modules/vfs_gpfs.c:1232(vfs_gpfs_is_offline)
SHOWME gpfs_get_xattr:Got attributes: 0xccaf0d70
[2012/09/28 07:01:23.514758, 10] modules/vfs_gpfs.c:1233(vfs_gpfs_is_offline)
SHOWME 3
[2012/09/28 07:01:23.514783, 8] smbd/dosmode.c:672(dos_mode)
dos_mode returning
[2012/09/28 07:01:23.514812, 10] locking/locking.c:1026(fetch_share_mode_unlocked)
fetch_share_mode_unlocked: no share_mode record around (file not open)
[2012/09/28 07:01:23.514839, 3] smbd/dir.c:1041(smbd_dirptr_get_entry)
smbd_dirptr_get_entry mask=[*] found test/test149.txt fname=test149.txt (test149.txt)
[2012/09/28 07:01:23.514868, 10] smbd/trans2.c:1572(smbd_marshall_dir_entry)
smbd_marshall_dir_entry: space_remaining = 55192
[2012/09/28 07:01:23.514894, 10] smbd/trans2.c:1944(smbd_marshall_dir_entry)
It looks like enterprise samba puts in a patch that creates gpfs_gpl.h during the rpm builds - I commented all this out from the spec file placed gpfs_gpl.h that is included with GPFS 3.5.0-3 in sources3/include to see if that would make a difference, recompiled, rebuild, tested, but the results are the same.
Here is the samba config of my simple test machine. I have confirmed now with three other sites running the 3.6 enterprise samba distributions (level varies), all on 3.6, all having the same issue, really strange.
[root at localhost samba]# cat /etc/samba/smb.conf
[global]
netbios name = TEST
disable netbios = yes
workgroup = test
vfs objects = gpfs fileid
gpfs:sharemodes = No
force unknown acl user = yes
nfs4: mode = special
nfs4: chown = yes
nfs4: acedup = merge
oplocks = Yes
veto oplock files = /*.lock/
level2 oplocks = Yes
mangled names = No
strict locking = No
template homedir = /home/%D/%U
usershare allow guests = No
template shell = /bin/bash
acl map full control = yes
acl group control = yes
inherit acls = yes
inherit permissions = yes
unix extensions = no
log level = 10
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=2097152 SO_SNDBUF=2097152
max protocol = SMB2
strict locking = no
load printers = no
printing = bsd
printcap name = /dev/null
disable spools = yes
[gpfs]
comment = gpfs
path = /gpfs
guest ok = No
guest only = No
read only = No
browseable = yes
Anything look interesting?
Many Thanks,
Barry
On 28 Sep 2012, at 16:20, Christian Ambach <ambi at samba.org> wrote:
> On 09/27/2012 01:29 PM, Barry Evans wrote:
>
>> I have tried this GPFS 3.4.0-10, 3.4.0-15, 3.5.0-2 and 3.5.03, all with the same result. (OS is base RHEL 6.2 and RHEL 6.3). This has appeared in XP, 7 and Server 2003 and Server 2008.
>
> Did you recompile Samba after each of the version changes?
>
>> Example from log level 10:
>>
>> [2012/09/27 20:50:48.588160, 10] modules/vfs_gpfs.c:1224(vfs_gpfs_is_offline)
>> xx/xx/xx/xx/xx/xx/xx/xx/xx.1015.exr is offline
>>
>> x's replacing pathnames for security in example
>>
>> I have also tried this with enterprise samba 3.5.18-44, this seems to work fine and the condition does not occur.
>>
>> Any one seen anything like this?
>
> No, haven't seen this before. I suspect that this is bad interaction between multiple VFS modules.
>
> Can you post your smb.conf please?
>
> Cheers,
> Christian
>
More information about the samba-technical
mailing list