summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-06-21 18:04:05 +0200
committerDavid Sterba <dsterba@suse.com>2018-08-06 13:12:38 +0200
commitafd48513f0019a2048afed0d98904d3fec7e05dd (patch)
treee1d06270a9aff6d87329b7a7ebb4fac2557a7888 /fs/btrfs/disk-io.c
parente41ca5897489b1c18af75ff0cc8f5c80260b3281 (diff)
downloadlinux-afd48513f0019a2048afed0d98904d3fec7e05dd.tar.bz2
btrfs: use monotonic time for transaction handling
The transaction times were changed to ktime_get_real_seconds to avoid the y2038 overflow, but they still have a minor problem when they go backwards or jump due to settimeofday() or leap seconds. This changes the transaction handling to instead use ktime_get_seconds(), which returns a CLOCK_MONOTONIC timestamp that has neither of those problems. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 6318ac2539d3..2de3da7b7bdc 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1805,7 +1805,7 @@ static int transaction_kthread(void *arg)
goto sleep;
}
- now = ktime_get_real_seconds();
+ now = ktime_get_seconds();
if (cur->state < TRANS_STATE_BLOCKED &&
!test_bit(BTRFS_FS_NEED_ASYNC_COMMIT, &fs_info->flags) &&
(now < cur->start_time ||