diff --git a/WHATS_NEW b/WHATS_NEW index a96b6447e..1758e5b96 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.00.23 - ==================================== + Use O_NOATIME on devices if available. Write log message when each segtype/format gets initialised. New commands 'segtypes' and 'formats'. Suppress pvmove abort message in test mode. diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c index 7dbc462ab..ed3ae9eea 100644 --- a/lib/device/dev-io.c +++ b/lib/device/dev-io.c @@ -300,6 +300,12 @@ int dev_open_flags(struct device *dev, int flags, int direct, int quiet) flags |= O_DIRECT; #endif +#ifdef O_NOATIME + /* Don't update atime on device inodes */ + if (!(dev->flags & DEV_REGULAR)) + flags |= O_NOATIME; +#endif + if ((dev->fd = open(name, flags, 0777)) < 0) { log_sys_error("open", name); return 0;