summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-05-18 06:02:07 +0200
committerVolker Lendecke <vl@samba.org>2009-05-20 15:15:57 +0200
commit54973d04221c4f45db1e33e49cfd445c81518f86 (patch)
tree4f55ed5b0b3d35858f32010294833c3d58835d3d /source3
parent3fbc871f70c2e711180def16b868cc03d0407461 (diff)
downloadsamba-54973d04221c4f45db1e33e49cfd445c81518f86.tar.gz
samba-54973d04221c4f45db1e33e49cfd445c81518f86.tar.bz2
samba-54973d04221c4f45db1e33e49cfd445c81518f86.zip
Fix bug disclosed by lock8 torture test
We have to drop the gpfs level share modes, regardless of whether we put the file into the pending close queue.
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_gpfs.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index b304d8bdc2..778f4a00fd 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -49,6 +49,19 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
return 0;
}
+static int vfs_gpfs_close(vfs_handle_struct *handle, files_struct *fsp)
+{
+ int result;
+
+ if ((fsp->fh != NULL) && (fsp->fh->fd != -1)) {
+ set_gpfs_sharemode(fsp, 0, 0);
+ }
+
+ result = fd_close_posix(fsp);
+
+ return result;
+}
+
static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
int leasetype)
{
@@ -923,6 +936,10 @@ static vfs_op_tuple gpfs_op_tuples[] = {
SMB_VFS_OP_FCHMOD,
SMB_VFS_LAYER_TRANSPARENT },
+ { SMB_VFS_OP(vfs_gpfs_close),
+ SMB_VFS_OP_CLOSE,
+ SMB_VFS_LAYER_TRANSPARENT },
+
{ SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP }
};