1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

Fix a race condition in vfs_aio_fork with gpfs share modes

This commit is contained in:
Volker Lendecke 2009-05-18 09:36:16 +02:00
parent f140bf2e65
commit 8b9c5f0483

View File

@ -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);
}
}