@@ -260,6 +260,9 @@ static int ntfs_file_mmap(struct file *file, struct vm_area_struct *vma)
260260 bool rw = vma -> vm_flags & VM_WRITE ;
261261 int err ;
262262
263+ if (unlikely (ntfs3_forced_shutdown (inode -> i_sb )))
264+ return - EIO ;
265+
263266 if (is_encrypted (ni )) {
264267 ntfs_inode_warn (inode , "mmap encrypted not supported" );
265268 return - EOPNOTSUPP ;
@@ -677,6 +680,9 @@ int ntfs3_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
677680 umode_t mode = inode -> i_mode ;
678681 int err ;
679682
683+ if (unlikely (ntfs3_forced_shutdown (inode -> i_sb )))
684+ return - EIO ;
685+
680686 err = setattr_prepare (idmap , dentry , attr );
681687 if (err )
682688 goto out ;
@@ -732,6 +738,9 @@ static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
732738 struct inode * inode = file -> f_mapping -> host ;
733739 struct ntfs_inode * ni = ntfs_i (inode );
734740
741+ if (unlikely (ntfs3_forced_shutdown (inode -> i_sb )))
742+ return - EIO ;
743+
735744 if (is_encrypted (ni )) {
736745 ntfs_inode_warn (inode , "encrypted i/o not supported" );
737746 return - EOPNOTSUPP ;
@@ -766,6 +775,9 @@ static ssize_t ntfs_file_splice_read(struct file *in, loff_t *ppos,
766775 struct inode * inode = in -> f_mapping -> host ;
767776 struct ntfs_inode * ni = ntfs_i (inode );
768777
778+ if (unlikely (ntfs3_forced_shutdown (inode -> i_sb )))
779+ return - EIO ;
780+
769781 if (is_encrypted (ni )) {
770782 ntfs_inode_warn (inode , "encrypted i/o not supported" );
771783 return - EOPNOTSUPP ;
@@ -1058,6 +1070,9 @@ static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
10581070 int err ;
10591071 struct ntfs_inode * ni = ntfs_i (inode );
10601072
1073+ if (unlikely (ntfs3_forced_shutdown (inode -> i_sb )))
1074+ return - EIO ;
1075+
10611076 if (is_encrypted (ni )) {
10621077 ntfs_inode_warn (inode , "encrypted i/o not supported" );
10631078 return - EOPNOTSUPP ;
@@ -1118,6 +1133,9 @@ int ntfs_file_open(struct inode *inode, struct file *file)
11181133{
11191134 struct ntfs_inode * ni = ntfs_i (inode );
11201135
1136+ if (unlikely (ntfs3_forced_shutdown (inode -> i_sb )))
1137+ return - EIO ;
1138+
11211139 if (unlikely ((is_compressed (ni ) || is_encrypted (ni )) &&
11221140 (file -> f_flags & O_DIRECT ))) {
11231141 return - EOPNOTSUPP ;
0 commit comments