aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <[email protected]>2017-09-06 16:23:19 -0700
committerLinus Torvalds <[email protected]>2017-09-06 17:27:28 -0700
commitde23abd15175fb170270d485f267caebe86fb0b4 (patch)
treedca2db2b3df4fb7b47b0e32f48baedcdd7ad0391
parent824f973904a1108806fa0fbe15dc93ee9ecd9e0a (diff)
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. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jeff Layton <[email protected]> Cc: Alexander Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--fs/sync.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/sync.c b/fs/sync.c
index 2a54c1f22035..cf57f33fcd16 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);