Skip to contentSkip to conversation

ntfs: delete dead code

PATCH In review Dan Carpenter 2 participants 2 messages Apr 10

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntfs: delete dead code

We know "ret2" is zero so there is no need to check. Delete the if statement.

---
 fs/ntfs/file.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
fs/ntfs/file.c +3 -4
index e5b897a6c1e1..b04919124989 100644
@@ -534,10 +534,9 @@ static ssize_t ntfs_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
 			ret = -EIO;
 			goto out;
 		}
-		if (!ret2)
-			invalidate_mapping_pages(iocb->ki_filp->f_mapping,
-						 offset >> PAGE_SHIFT,
-						 end >> PAGE_SHIFT);
+		invalidate_mapping_pages(iocb->ki_filp->f_mapping,
+					 offset >> PAGE_SHIFT,
+					 end >> PAGE_SHIFT);
 	}
 
 out:
Signature · 1 line
2.53.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

2026년 4월 10일 (금) 오후 7:11, Dan Carpenter <[email protected]>님이 작성:

Quoted 5 lines

We know "ret2" is zero so there is no need to check. Delete the if statement.

Looks good to me.

Quoted 25 lines
---
 fs/ntfs/file.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
fs/ntfs/file.c +3 -5
index e5b897a6c1e1..b04919124989 100644
@@ -534,10 +534,9 @@ static ssize_t ntfs_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
                        ret = -EIO;
                        goto out;
                }
-               if (!ret2)
-                       invalidate_mapping_pages(iocb->ki_filp->f_mapping,
-                                                offset >> PAGE_SHIFT,
-                                                end >> PAGE_SHIFT);
+               invalidate_mapping_pages(iocb->ki_filp->f_mapping,
+                                        offset >> PAGE_SHIFT,
+                                        end >> PAGE_SHIFT);
        }
 
 out:
--

2.53.0

Signature · 2 lines
Thanks,
Hyunchul