mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
afs: afs_write_end() should change i_size under the right lock
[ Upstream commit1f32ef7989] 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:4343d00872("afs: Get rid of the afs_writeback record") Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6a9fd8046f
commit
c8c19fcdab
@@ -194,11 +194,11 @@ int afs_write_end(struct file *file, struct address_space *mapping,
|
||||
|
||||
i_size = i_size_read(&vnode->vfs_inode);
|
||||
if (maybe_i_size > i_size) {
|
||||
spin_lock(&vnode->wb_lock);
|
||||
write_seqlock(&vnode->cb_lock);
|
||||
i_size = i_size_read(&vnode->vfs_inode);
|
||||
if (maybe_i_size > i_size)
|
||||
i_size_write(&vnode->vfs_inode, maybe_i_size);
|
||||
spin_unlock(&vnode->wb_lock);
|
||||
write_sequnlock(&vnode->cb_lock);
|
||||
}
|
||||
|
||||
if (!PageUptodate(page)) {
|
||||
|
||||
Reference in New Issue
Block a user