Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/20170525110509.9434-1-jlayton@redhat.com
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jeff Layton and committed by
Linus Torvalds
de23abd1 824f9739

-5
-5
fs/sync.c
··· 335 335 goto out_put; 336 336 337 337 mapping = f.file->f_mapping; 338 - if (!mapping) { 339 - ret = -EINVAL; 340 - goto out_put; 341 - } 342 - 343 338 ret = 0; 344 339 if (flags & SYNC_FILE_RANGE_WAIT_BEFORE) { 345 340 ret = filemap_fdatawait_range(mapping, offset, endbyte);