[PATCH] fs: remove unnecessary NULL f_mapping check in sync_file_range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fsync codepath assumes that f_mapping can never be NULL, but
sync_file_range has a check for that. Remove the one from sync_file_range
as I don't see how you'd ever get a NULL pointer in here.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
 fs/sync.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/sync.c b/fs/sync.c
index 11ba023434b1..45ecf6854595 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -335,11 +335,6 @@ SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes,
 		goto out_put;
 
 	mapping = f.file->f_mapping;
-	if (!mapping) {
-		ret = -EINVAL;
-		goto out_put;
-	}
-
 	ret = 0;
 	if (flags & SYNC_FILE_RANGE_WAIT_BEFORE) {
 		ret = filemap_fdatawait_range(mapping, offset, endbyte);
-- 
2.9.4




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux