afs: afs_write_end() should change i_size under the right lock
authorDavid Howells <dhowells@redhat.com>
Fri, 12 Jun 2020 22:58:51 +0000 (23:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:50:46 +0000 (17:50 +0200)
commitc8c19fcdabdbcc923564cc9258b01db3c0e0ed22
tree2ce86be3417abe3013dbfb481124775ba6be858d
parent6a9fd8046fbd32248b5f18c023c2689834e5ff95
afs: afs_write_end() should change i_size under the right lock

[ Upstream commit 1f32ef79897052ef7d3d154610d8d6af95abde83 ]

Fix afs_write_end() to change i_size under vnode->cb_lock rather than
->wb_lock so that it doesn't race with afs_vnode_commit_status() and
afs_getattr().

The ->wb_lock is only meant to guard access to ->wb_keys which isn't
accessed by that piece of code.

Fixes: 4343d00872e1 ("afs: Get rid of the afs_writeback record")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/afs/write.c