[PATCH 4/5] afs: Zero bytes after 'oldsize' if we're expanding the file

David Howells dhowells at redhat.com
Mon Feb 27 06:49:59 PST 2023


Matthew Wilcox <willy at infradead.org> 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




More information about the linux-afs mailing list