Re: [PATCH] exfat: drain dirty pages after forced shutdown
From: Namjae Jeon
Date: Mon Oct 26 2026 - 07:02:42 EST
> @@ -283,9 +283,6 @@ static int exfat_writepages(struct address_space *mapping,
> .ops = &exfat_writeback_ops,
> };
>
> - if (unlikely(exfat_forced_shutdown(mapping->host->i_sb)))
> - return -EIO;
Please move this check to exfat_writeback_range(). Returning -EIO
there lets iomap clear dirty state without writing data after
shutdown.
> -
> return iomap_writepages(&wpc);
> }
>
> diff --git a/fs/exfat/iomap.c b/fs/exfat/iomap.c
> index e50ecbfbfbe0..6383739f5700 100644
> --- a/fs/exfat/iomap.c
> +++ b/fs/exfat/iomap.c
> @@ -165,6 +165,9 @@ static int exfat_write_iomap_begin(struct inode *inode, loff_t offset, loff_t le
> loff_t end;
> int err;
>
> + if (exfat_forced_shutdown(inode->i_sb))
> + return -EIO;
This check is not needed for this hang fix. exfat_file_write_iter()
already checks new writes after shutdown.
It also misses existing mmap writes, which use exfat_iomap_ops. We
need to add a shutdown check to exfat_page_mkwrite() also.
Thanks.