Amir Goldstein c553ea4fdf fs/sync.c: sync_file_range(2) may use WB_SYNC_ALL writeback
23d0127096cb ("fs/sync.c: make sync_file_range(2) use WB_SYNC_NONE
writeback") claims that sync_file_range(2) syscall was "created for
userspace to be able to issue background writeout and so waiting for
in-flight IO is undesirable there" and changes the writeback (back) to
WB_SYNC_NONE.

This claim is only partially true.  It is true for users that use the flag
SYNC_FILE_RANGE_WRITE by itself, as does PostgreSQL, the user that was the
reason for changing to WB_SYNC_NONE writeback.

However, that claim is not true for users that use that flag combination
SYNC_FILE_RANGE_{WAIT_BEFORE|WRITE|_WAIT_AFTER}.  Those users explicitly
requested to wait for in-flight IO as well as to writeback of dirty pages.

Re-brand that flag combination as SYNC_FILE_RANGE_WRITE_AND_WAIT and use
WB_SYNC_ALL writeback to perform the full range sync request.

Link: http://lkml.kernel.org/r/20190409114922.30095-1-amir73il@gmail.com
Link: http://lkml.kernel.org/r/20190419072938.31320-1-amir73il@gmail.com
Fixes: 23d0127096cb ("fs/sync.c: make sync_file_range(2) use WB_SYNC_NONE")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Jan Kara <jack@suse.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-05-14 09:47:50 -07:00
..
2019-05-01 22:43:23 -04:00
2019-05-07 20:51:58 -07:00
2019-05-01 22:43:23 -04:00
2019-05-01 22:43:24 -04:00
2019-05-07 18:14:36 -07:00
2019-05-01 22:43:26 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-01 22:43:24 -04:00
2019-05-07 11:37:27 -07:00
2019-05-01 22:43:25 -04:00
2019-05-09 14:33:15 -07:00
2019-05-09 14:33:15 -07:00
2019-05-01 22:43:25 -04:00
2019-05-01 22:43:26 -04:00
2019-05-01 22:43:25 -04:00
2019-05-01 22:43:25 -04:00
2019-05-01 22:43:25 -04:00
2019-05-01 22:43:25 -04:00
2019-05-07 18:14:36 -07:00
2018-10-29 14:29:58 -07:00
2019-05-14 09:47:48 -07:00
2019-03-07 18:32:01 -08:00
2019-04-08 18:21:02 -05:00
2019-03-08 14:48:40 -08:00
2019-05-07 18:14:36 -07:00
2019-01-30 17:44:07 -05:00
2019-04-09 19:20:57 -04:00
2019-04-26 11:09:55 -07:00
2019-04-06 10:48:35 -06:00
2019-02-07 16:38:35 +01:00