git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f140bf2
)
Fix a race condition in vfs_aio_fork with gpfs share modes
author
Volker Lendecke
<vl@samba.org>
Mon, 18 May 2009 07:36:16 +0000
(09:36 +0200)
committer
Volker Lendecke
<vl@samba.org>
Mon, 18 May 2009 08:42:22 +0000
(10:42 +0200)
source3/modules/vfs_aio_fork.c
patch
|
blob
|
history
diff --git
a/source3/modules/vfs_aio_fork.c
b/source3/modules/vfs_aio_fork.c
index 8568ec39165d6e250e06d3ab5d279afb42f68240..e706495a56f7cd407cd4dc06d6da13e4e9aa49cd 100644
(file)
--- a/
source3/modules/vfs_aio_fork.c
+++ b/
source3/modules/vfs_aio_fork.c
@@
-357,6
+357,14
@@
static void aio_child_loop(int sockfd, struct mmap_area *map)
ret_struct.ret_errno = errno;
}
+ /*
+ * Close the fd before telling our parent we're done. The
+ * parent might close and re-open the file very quickly, and
+ * with system-level share modes (GPFS) we would get an
+ * unjustified SHARING_VIOLATION.
+ */
+ close(fd);
+
ret = write_data(sockfd, (char *)&ret_struct,
sizeof(ret_struct));
if (ret != sizeof(ret_struct)) {
@@
-364,8
+372,6
@@
static void aio_child_loop(int sockfd, struct mmap_area *map)
strerror(errno)));
exit(2);
}
-
- close(fd);
}
}