Skip to contentSkip to conversation

fs: remove unnecessary NULL f_mapping check in sync_file_range

PATCH Applied Jeff Layton 1 participant 1 message May 25, 2017 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: remove unnecessary NULL f_mapping check in sync_file_range

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.

---
 fs/sync.c | 5 -----
 1 file changed, 5 deletions(-)
fs/sync.c +0 -5
index 11ba023434b1..45ecf6854595 100644
@@ -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);
Signature · 1 line
2.9.4