diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 935dcc803ebb..857cd3030cae 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -813,7 +813,16 @@ static ssize_t exfat_splice_read(struct file *in, loff_t *ppos, return filemap_splice_read(in, ppos, pipe, len, flags); } +static int exfat_file_open(struct inode *inode, struct file *filp) +{ + if (unlikely(exfat_forced_shutdown(inode->i_sb))) + return -EIO; + + return generic_file_open(inode, filp); +} + const struct file_operations exfat_file_operations = { + .open = exfat_file_open, .llseek = generic_file_llseek, .read_iter = exfat_file_read_iter, .write_iter = exfat_file_write_iter,