diff options
author | Christof Schmitt <christof.schmitt@us.ibm.com> | 2012-08-16 12:47:52 -0700 |
---|---|---|
committer | Christian Ambach <ambi@samba.org> | 2012-08-29 18:58:33 +0200 |
commit | 6678907fae43e0d25b578b4e649a2fbd9c5e9d71 (patch) | |
tree | 6e0bad3d06ea60c0c6c51e409124184988122711 /source3/modules/gpfs.c | |
parent | f31d0d0e30af6577de483ec4e811b9422b8ef39a (diff) | |
download | samba-6678907fae43e0d25b578b4e649a2fbd9c5e9d71.tar.gz samba-6678907fae43e0d25b578b4e649a2fbd9c5e9d71.tar.bz2 samba-6678907fae43e0d25b578b4e649a2fbd9c5e9d71.zip |
s3:vfs_gpfs: Use directory not file to get fileset id
The query of the fileset quota needs to determine the file set id first.
With the currently available interface, this requires opening the file
to get a file descriptor. For files, this open can fail when a share
mode is set.
Workaround this by querying the fileset id on the directory instead.
The proper solution would be getting an interface for getting the
fileset id that does not require opening the file.
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Aug 29 18:58:34 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3/modules/gpfs.c')
-rw-r--r-- | source3/modules/gpfs.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c index db6025642b..9730d3af61 100644 --- a/source3/modules/gpfs.c +++ b/source3/modules/gpfs.c @@ -253,8 +253,11 @@ int get_gpfs_fset_id(const char *pathname, int *fset_id) arg.fsn.structType = GPFS_FCNTL_GET_FILESETNAME; fd = open(pathname, O_RDONLY); - if (fd == -1) + if (fd == -1) { + DEBUG(1, ("Could not open %s: %s\n", + pathname, strerror(errno))); return fd; + } err = gpfs_fcntl_fn(fd, &arg); errno_fcntl = errno; @@ -262,11 +265,18 @@ int get_gpfs_fset_id(const char *pathname, int *fset_id) if (err) { errno = errno_fcntl; + DEBUG(1, ("GPFS_FCNTL_GET_FILESETNAME for %s failed: %s\n", + pathname, strerror(errno))); return err; } - return gpfs_getfilesetid_fn(discard_const_p(char, pathname), - arg.fsn.buffer, fset_id); + err = gpfs_getfilesetid_fn(discard_const_p(char, pathname), + arg.fsn.buffer, fset_id); + if (err) { + DEBUG(1, ("gpfs_getfilesetid for %s failed: %s\n", + pathname, strerror(errno))); + } + return err; } void smbd_gpfs_lib_init() |