Re: [PATCH 4/5] afs: Zero bytes after 'oldsize' if we're expanding the file
From: David Howells
Date: Mon Feb 27 2023 - 09:50:54 EST
Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> I'll send a patch series with all of this; it doesn't seem terribly
> urgent. Do you think there's a similar problem for AFS that Brian
> noted with the generic patch?
Probably not. To avoid deadlocking itself, afs uses a mutex to prevent
writepages racing with truncate (vnode->validate_lock).
commit ec0fa0b659144d9c68204d23f627b6a65fa53e50
afs: Fix deadlock between writeback and truncate
the afs_setattr_edit_file() call that changes i_size and partially clears the
pagecache is applied to the local inode before the mutex is dropped.
David