]> git.ipfire.org Git - thirdparty/linux.git/commit - include/linux/fs.h
ovl: skip overlayfs superblocks at global sync
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Thu, 9 Apr 2020 08:29:47 +0000 (11:29 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 13 May 2020 09:11:24 +0000 (11:11 +0200)
commit32b1924b210a70dcacdf65abd687c5ef86a67541
tree19372bfcaac553c2f8dd787e13fd0a8f23039cb2
parent62a8a85be8355b01330667c2b4676fb60c184380
ovl: skip overlayfs superblocks at global sync

Stacked filesystems like overlayfs has no own writeback, but they have to
forward syncfs() requests to backend for keeping data integrity.

During global sync() each overlayfs instance calls method ->sync_fs() for
backend although it itself is in global list of superblocks too.  As a
result one syscall sync() could write one superblock several times and send
multiple disk barriers.

This patch adds flag SB_I_SKIP_SYNC into sb->sb_iflags to avoid that.

Reported-by: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/super.c
fs/sync.c
include/linux/fs.h