Blame SOURCES/0031-fs-ntfs3-Remove-unnecessary-condition-checking-from-.patch

Kmods SIG 8b815c
From dd854e4b5b12016d27bfa2694226a1c15acbd640 Mon Sep 17 00:00:00 2001
Kmods SIG 8b815c
From: Kari Argillander <kari.argillander@gmail.com>
Kmods SIG 8b815c
Date: Wed, 25 Aug 2021 21:25:22 +0300
Kmods SIG 8b815c
Subject: [Backport dd854e4b5b12] src: Remove unnecessary condition
Kmods SIG 8b815c
 checking from ntfs_file_read_iter
Kmods SIG 8b815c
Kmods SIG 8b815c
This check will be also performed in generic_file_read_iter() so we do
Kmods SIG 8b815c
not want to check this two times in a row.
Kmods SIG 8b815c
Kmods SIG 8b815c
This was founded with Smatch
Kmods SIG 8b815c
	src/file.c:803 ntfs_file_read_iter()
Kmods SIG 8b815c
	warn: unused return: count = iov_iter_count()
Kmods SIG 8b815c
Kmods SIG 8b815c
Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Kmods SIG 8b815c
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Kmods SIG 8b815c
---
Kmods SIG 8b815c
 src/file.c | 6 +-----
Kmods SIG 8b815c
 1 file changed, 1 insertion(+), 5 deletions(-)
Kmods SIG 8b815c
Kmods SIG 8b815c
diff --git a/src/file.c b/src/file.c
Kmods SIG 8b815c
index f9c9a8c91b46d6fad597c954c3b4a2cd331ebfb6..424450e77ad52ae550e8de444dc393411d97cde6 100644
Kmods SIG 8b815c
--- a/src/file.c
Kmods SIG 8b815c
+++ b/src/file.c
Kmods SIG 8b815c
@@ -793,8 +793,6 @@ int ntfs3_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
Kmods SIG 8b815c
 
Kmods SIG 8b815c
 static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
Kmods SIG 8b815c
 {
Kmods SIG 8b815c
-	ssize_t err;
Kmods SIG 8b815c
-	size_t count = iov_iter_count(iter);
Kmods SIG 8b815c
 	struct file *file = iocb->ki_filp;
Kmods SIG 8b815c
 	struct inode *inode = file->f_mapping->host;
Kmods SIG 8b815c
 	struct ntfs_inode *ni = ntfs_i(inode);
Kmods SIG 8b815c
@@ -823,9 +821,7 @@ static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
Kmods SIG 8b815c
 		return -EOPNOTSUPP;
Kmods SIG 8b815c
 	}
Kmods SIG 8b815c
 
Kmods SIG 8b815c
-	err = count ? generic_file_read_iter(iocb, iter) : 0;
Kmods SIG 8b815c
-
Kmods SIG 8b815c
-	return err;
Kmods SIG 8b815c
+	return generic_file_read_iter(iocb, iter);
Kmods SIG 8b815c
 }
Kmods SIG 8b815c
 
Kmods SIG 8b815c
 /*
Kmods SIG 8b815c
-- 
Kmods SIG 8b815c
2.31.1
Kmods SIG 8b815c