]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Re-enable freezing once a page fault is interrupted
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 16 Jun 2021 21:22:28 +0000 (22:22 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 18 Jun 2021 20:49:07 +0000 (13:49 -0700)
commit562b220e5268bcf80257fa6b8c6a372774bca525
tree3d79aa05ed9f88b8d5e52cd49de692233fae030b
parent6e6c42414e0c965676e214e16d6ddabd0b01df9b
afs: Re-enable freezing once a page fault is interrupted

If a task is killed during a page fault, it does not currently call
sb_end_pagefault(), which means that the filesystem cannot be frozen
at any time thereafter.  This may be reported by lockdep like this:

====================================
WARNING: fsstress/10757 still has locks held!
5.13.0-rc4-build4+ #91 Not tainted
------------------------------------
1 lock held by fsstress/10757:
 #0: ffff888104eac530
 (
sb_pagefaults

as filesystem freezing is modelled as a lock.

Fix this by removing all the direct returns from within the function,
and using 'ret' to indicate whether we were interrupted or successful.

Fixes: 0a056d2da88a ("afs: Implement shared-writeable mmap")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/20210616154900.1958373-1-willy@infradead.org/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/write.c