summaryrefslogtreecommitdiff
path: root/fs/btrfs/transaction.h
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2021-03-23 21:39:49 +0300
committerDavid Sterba <dsterba@suse.com>2021-04-19 18:25:17 +0300
commitb7a7a8346378d7ddb35e02bdb81cf6a6fbe366af (patch)
tree11326c4e2256f8e4339dfc6bd023209f31b99577 /fs/btrfs/transaction.h
parentbb05b298af8b2330db2b39971bf0029798e7ad59 (diff)
downloadlinux-b7a7a8346378d7ddb35e02bdb81cf6a6fbe366af.tar.xz
btrfs: make reflinks respect O_SYNC O_DSYNC and S_SYNC flags
If we reflink to or from a file opened with O_SYNC/O_DSYNC or to/from a file that has the S_SYNC attribute set, we totally ignore that and do not durably persist the reflink changes. Since a reflink can change the data readable from a file (and mtime/ctime, or a file size), it makes sense to durably persist (fsync) the source and destination files/ranges. This was previously discussed at: https://lore.kernel.org/linux-btrfs/20200903035225.GJ6090@magnolia/ The recently introduced test case generic/628, from fstests, exercises these scenarios and currently fails without this change. So make sure we fsync the source and destination files/ranges when either of them was opened with O_SYNC/O_DSYNC or has the S_SYNC attribute set, just like XFS already does. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
0 files changed, 0 insertions, 0 deletions