Skip to contentSkip to conversation

fs/sync.c: remove unnecessary NULL f_mapping check in sync_file_range

PATCH In review [email protected] 1 participant 1 message Sep 6, 2017 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 85/119 fs/sync.c: remove unnecessary NULL f_mapping check in sync_file_range

From: Jeff Layton <[email protected]>
Subject: fs/sync.c: 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 renamed from fs/sync.c~fs-remove-unnecessary-null-f_mapping-check-in-sync_file_range +0 -4
diff -puN fs/sync.c~fs-remove-unnecessary-null-f_mapping-check-in-sync_file_range fs/sync.c
@@ -335,11 +335,6 @@ SYSCALL_DEFINE4(sync_file_range, int, fd
 		goto out_put;
 
 	mapping = f.file->f_mapping;
-	if (!mapping) {
-		ret = -EINVAL;
-		goto out_put;
-	}