Skip to content

Commit 478ad02

Browse files
committed
Disable FOP_DONTCACHE for now due to bugs
This is kind of last-minute, but Al Viro reported that the new FOP_DONTCACHE flag causes memory corruption due to use-after-free issues. This was triggered by commit 974c5e6 ("xfs: flag as supporting FOP_DONTCACHE"), but that is not the underlying bug - it is just the first user of the flag. Vlastimil Babka suspects the underlying problem stems from the folio_end_writeback() logic introduced in commit fb7d3bc ("mm/filemap: drop streaming/uncached pages when writeback completes"). The most straightforward fix would be to just revert the commit that exposed this, but Matthew Wilcox points out that other filesystems are also starting to enable the FOP_DONTCACHE logic, so this instead disables that bit globally for now. The fix will hopefully end up being trivial and we can just re-enable this logic after more testing, but until such a time we'll have to disable the new FOP_DONTCACHE flag. Reported-by: Al Viro <[email protected]> Link: https://lore.kernel.org/all/20250525083209.GS2023217@ZenIV/ Triggered-by: 974c5e6 ("xfs: flag as supporting FOP_DONTCACHE") Cc: Vlastimil Babka <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Jan Kara <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Darrick J. Wong <[email protected]> Cc: Christian Brauner <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0f8c025 commit 478ad02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,7 @@ struct file_operations {
21862186
/* Supports asynchronous lock callbacks */
21872187
#define FOP_ASYNC_LOCK ((__force fop_flags_t)(1 << 6))
21882188
/* File system supports uncached read/write buffered IO */
2189-
#define FOP_DONTCACHE ((__force fop_flags_t)(1 << 7))
2189+
#define FOP_DONTCACHE 0 /* ((__force fop_flags_t)(1 << 7)) */
21902190

21912191
/* Wrap a directory iterator that needs exclusive inode access */
21922192
int wrap_directory_iterator(struct file *, struct dir_context *,

0 commit comments

Comments
 (0)