[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1423-g175662b

Alexander Bokovoy ab at samba.org
Thu Jan 17 04:44:58 GMT 2008

Jeremy Allison пишет:
> On Wed, Jan 16, 2008 at 09:54:00AM -0600, Alexander Bokovoy wrote: 
> This is bad code and needs fixing.
I'm deeply sorry for this. Thank you for fixing part of those issues.

> int vfswrap_is_offline(struct vfs_handle_struct *handle, struct 
> connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf, 
> bool *offline)
> Looks like a question for which the correct return is a bool. But it 
> returns a tristate, 1, 0, -1. WHAT DO THESE THINGS MEAN ?
It returns offline status in the *offline and returns the status of
the whole operation (two-state, supported/non-supported on the system)
as 0/-1 much like we do with other system calls.

The problem here is that offline status could be non-existent on the
system (i.e. there is no backup and archiving integration with file
system in question). We return -1 in this case from a specialized module
and upper level then doesn't look into *offline. In default action
(vfs_default.c) we do so if there is no DMAPI enabled, this code path is
the same as was before, without VFS abstraction. MacOS X uses DMAPI to
communicate offline status, in vfs_tsmsm we do use DMAPI to get offline
status from GPFS too.

Had it be bool, it would be greater confusion because you'd have two
bools then.

/ Alexander Bokovoy
Samba Team                      http://www.samba.org/
ALT Linux Team                  http://www.altlinux.org/
Midgard Project Ry              http://www.midgard-project.org/

More information about the samba-technical mailing list