]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix the race in cifs_writev()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 3 Apr 2014 14:27:17 +0000 (10:27 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 12 Apr 2014 10:52:48 +0000 (06:52 -0400)
commit9d0eb4dfdac1a13e80810fdeee6258818a5d03d9
tree3846636f530b1e23d685b1652cd73ab8707445fb
parent8177d0dc1bc491bd223696f10540879af762fb8a
cifs: fix the race in cifs_writev()

O_APPEND handling there hadn't been completely fixed by Pavel's
patch; it checks the right value, but it's racy - we can't really
do that until i_mutex has been taken.

Fix by switching to __generic_file_aio_write() (open-coding
generic_file_aio_write(), actually) and pulling mutex_lock() above
inode_size_read().

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/file.c