[CIFS] Fix losing locks during fork()
authorPavel Shilovsky <piastryyy@gmail.com>
Wed, 21 Apr 2010 19:44:24 +0000 (19:44 +0000)
committerSteve French <sfrench@us.ibm.com>
Wed, 21 Apr 2010 19:44:24 +0000 (19:44 +0000)
commit2c964d1f7c87eb71f7902111cd7c8fbba225e4b6
tree926ea339b7731049c363411bfc87094566488f43
parentf19159dc5ab9ec28c3b8230689101335d98e2d68
[CIFS] Fix losing locks during fork()

When process does fork() private_data of files with lock list stays the same
for file descriptors of the parent and of the child. While finishing the child closes
files and deletes locks from the list even if unlocking fails. When the child process
finishes the parent doesn't have lock in lock list and can't unlock previously before
fork() locked region after the child process finished.

This patch provides behaviour to save locks in lock list if unlocking fails.

Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/file.c