From 25fac9a0f6d290a1454a0b755183edd063354d7a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 25 Nov 2014 11:07:39 -0500 Subject: [PATCH] V3 version of the lazytime patches --- add-lazytime-tracepoints | 187 +++++++-------------- btrfs-drop-update_time | 153 +++++++++++++++++ ...let-dirty-time-inodes-get-more-than-a-day-stale | 43 +++-- ext4-add-lazytime-mount-option | 15 +- series | 12 +- split-update_time-into-update_time-and-write_time | 31 +++- timestamps | 41 ++--- vfs-add-lazytime-mount-option | 15 +- 8 files changed, 312 insertions(+), 185 deletions(-) rewrite add-lazytime-tracepoints (61%) create mode 100644 btrfs-drop-update_time diff --git a/add-lazytime-tracepoints b/add-lazytime-tracepoints dissimilarity index 61% index d1da8921..d9a84906 100644 --- a/add-lazytime-tracepoints +++ b/add-lazytime-tracepoints @@ -1,125 +1,62 @@ -vfs: add lazytime tracepoints for better debugging - -Signed-off-by: Theodore Ts'o ---- - fs/fs-writeback.c | 5 ++++- - fs/inode.c | 5 +++++ - include/trace/events/fs.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 65 insertions(+), 1 deletion(-) - -diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c -index eb04277..cab2d6d 100644 ---- a/fs/fs-writeback.c -+++ b/fs/fs-writeback.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - #include "internal.h" - - /* -@@ -1304,8 +1305,10 @@ static void flush_sb_dirty_time(struct super_block *sb) - iput(old_inode); - old_inode = inode; - -- if (dirty_time) -+ if (dirty_time) { -+ trace_fs_lazytime_flush(inode); - mark_inode_dirty(inode); -+ } - cond_resched(); - spin_lock(&inode_sb_list_lock); - } -diff --git a/fs/inode.c b/fs/inode.c -index 0d939a8..5a9a7b0 100644 ---- a/fs/inode.c -+++ b/fs/inode.c -@@ -20,6 +20,9 @@ - #include - #include "internal.h" - -+#define CREATE_TRACE_POINTS -+#include -+ - /* - * Inode locking rules: - * -@@ -544,6 +547,7 @@ static void evict(struct inode *inode) - mark_inode_dirty(inode); - inode->i_sb->s_op->write_inode(inode, &wbc); - } -+ trace_fs_lazytime_evict(inode); - } - - if (!list_empty(&inode->i_wb_list)) -@@ -1546,6 +1550,7 @@ static int update_time(struct inode *inode, struct timespec *time, int flags) - inode->i_state |= I_DIRTY_TIME; - spin_unlock(&inode->i_lock); - inode->i_ts_dirty_day = days_since_boot; -+ trace_fs_lazytime_defer(inode); - return 0; - } - inode->i_ts_dirty_day = 0; -diff --git a/include/trace/events/fs.h b/include/trace/events/fs.h -new file mode 100644 -index 0000000..ca06d5c ---- /dev/null -+++ b/include/trace/events/fs.h -@@ -0,0 +1,56 @@ -+#undef TRACE_SYSTEM -+#define TRACE_SYSTEM fs -+ -+#if !defined(_TRACE_FS_H) || defined(TRACE_HEADER_MULTI_READ) -+#define _TRACE_FS_H -+ -+#include -+ -+DECLARE_EVENT_CLASS(fs__inode, -+ TP_PROTO(struct inode *inode), -+ -+ TP_ARGS(inode), -+ -+ TP_STRUCT__entry( -+ __field( dev_t, dev ) -+ __field( ino_t, ino ) -+ __field( uid_t, uid ) -+ __field( gid_t, gid ) -+ __field( __u16, mode ) -+ ), -+ -+ TP_fast_assign( -+ __entry->dev = inode->i_sb->s_dev; -+ __entry->ino = inode->i_ino; -+ __entry->uid = i_uid_read(inode); -+ __entry->gid = i_gid_read(inode); -+ __entry->mode = inode->i_mode; -+ ), -+ -+ TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u", -+ MAJOR(__entry->dev), MINOR(__entry->dev), -+ (unsigned long) __entry->ino, __entry->mode, -+ __entry->uid, __entry->gid) -+); -+ -+DEFINE_EVENT(fs__inode, fs_lazytime_defer, -+ TP_PROTO(struct inode *inode), -+ -+ TP_ARGS(inode) -+); -+ -+DEFINE_EVENT(fs__inode, fs_lazytime_evict, -+ TP_PROTO(struct inode *inode), -+ -+ TP_ARGS(inode) -+); -+ -+DEFINE_EVENT(fs__inode, fs_lazytime_flush, -+ TP_PROTO(struct inode *inode), -+ -+ TP_ARGS(inode) -+); -+#endif /* _TRACE_FS_H */ -+ -+/* This part must be outside protection */ -+#include +vfs: add lazytime tracepoints for better debugging + +Signed-off-by: Theodore Ts'o +--- + fs/fs-writeback.c | 5 ++++- + fs/inode.c | 5 +++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c +index eb04277..cab2d6d 100644 +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include "internal.h" + + /* +@@ -1304,8 +1305,10 @@ static void flush_sb_dirty_time(struct super_block *sb) + iput(old_inode); + old_inode = inode; + +- if (dirty_time) ++ if (dirty_time) { ++ trace_fs_lazytime_flush(inode); + mark_inode_dirty(inode); ++ } + cond_resched(); + spin_lock(&inode_sb_list_lock); + } +diff --git a/fs/inode.c b/fs/inode.c +index 34a443f..6319ead 100644 +--- a/fs/inode.c ++++ b/fs/inode.c +@@ -20,6 +20,9 @@ + #include + #include "internal.h" + ++#define CREATE_TRACE_POINTS ++#include ++ + /* + * Inode locking rules: + * +@@ -544,6 +547,7 @@ static void evict(struct inode *inode) + mark_inode_dirty(inode); + inode->i_sb->s_op->write_inode(inode, &wbc); + } ++ trace_fs_lazytime_evict(inode); + } + + if (!list_empty(&inode->i_wb_list)) +@@ -1550,6 +1554,7 @@ static int update_time(struct inode *inode, struct timespec *time, int flags) + inode->i_state |= I_DIRTY_TIME; + spin_unlock(&inode->i_lock); + inode->i_ts_dirty_day = daycode; ++ trace_fs_lazytime_defer(inode); + return 0; + } + } diff --git a/btrfs-drop-update_time b/btrfs-drop-update_time new file mode 100644 index 00000000..23dffd0b --- /dev/null +++ b/btrfs-drop-update_time @@ -0,0 +1,153 @@ +btrfs: add an is_readonly() so btrfs can use common code for update_time() + +The only reason btrfs cloned code from the VFS layer was so it could +add a check to see if a subvolume is read-ony. Instead of doing that, +let's add a new inode operation which allows a file system to return +an error if the inode is read-only, and use that in update_time(). +There may be other places where the VFS layer may want to know that +btrfs would want to treat an inode is read-only. + +With this commit, there are no remaining users of update_time() in the +inode operations structure, so we can remove it and simply things +further. + +Signed-off-by: Theodore Ts'o +Cc: linux-btrfs@vger.kernel.org +--- + fs/btrfs/inode.c | 26 ++++++-------------------- + fs/inode.c | 22 +++++++++++----------- + include/linux/fs.h | 2 +- + 3 files changed, 18 insertions(+), 32 deletions(-) + +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c +index a5e0d0d..0bfe3a4 100644 +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -5554,26 +5554,12 @@ static int btrfs_dirty_inode(struct inode *inode) + return ret; + } + +-/* +- * This is a copy of file_update_time. We need this so we can return error on +- * ENOSPC for updating the inode in the case of file write and mmap writes. +- */ +-static int btrfs_update_time(struct inode *inode, struct timespec *now, +- int flags) ++static int btrfs_is_readonly(struct inode *inode) + { + struct btrfs_root *root = BTRFS_I(inode)->root; + + if (btrfs_root_readonly(root)) + return -EROFS; +- +- if (flags & S_VERSION) +- inode_inc_iversion(inode); +- if (flags & S_CTIME) +- inode->i_ctime = *now; +- if (flags & S_MTIME) +- inode->i_mtime = *now; +- if (flags & S_ATIME) +- inode->i_atime = *now; + return 0; + } + +@@ -9466,8 +9452,8 @@ static const struct inode_operations btrfs_dir_inode_operations = { + .permission = btrfs_permission, + .get_acl = btrfs_get_acl, + .set_acl = btrfs_set_acl, +- .update_time = btrfs_update_time, + .write_time = btrfs_write_time, ++ .is_readonly = btrfs_is_readonly, + .tmpfile = btrfs_tmpfile, + }; + static const struct inode_operations btrfs_dir_ro_inode_operations = { +@@ -9475,8 +9461,8 @@ static const struct inode_operations btrfs_dir_ro_inode_operations = { + .permission = btrfs_permission, + .get_acl = btrfs_get_acl, + .set_acl = btrfs_set_acl, +- .update_time = btrfs_update_time, + .write_time = btrfs_write_time, ++ .is_readonly = btrfs_is_readonly, + }; + + static const struct file_operations btrfs_dir_file_operations = { +@@ -9546,8 +9532,8 @@ static const struct inode_operations btrfs_file_inode_operations = { + .fiemap = btrfs_fiemap, + .get_acl = btrfs_get_acl, + .set_acl = btrfs_set_acl, +- .update_time = btrfs_update_time, + .write_time = btrfs_write_time, ++ .is_readonly = btrfs_is_readonly, + }; + static const struct inode_operations btrfs_special_inode_operations = { + .getattr = btrfs_getattr, +@@ -9559,8 +9545,8 @@ static const struct inode_operations btrfs_special_inode_operations = { + .removexattr = btrfs_removexattr, + .get_acl = btrfs_get_acl, + .set_acl = btrfs_set_acl, +- .update_time = btrfs_update_time, + .write_time = btrfs_write_time, ++ .is_readonly = btrfs_is_readonly, + }; + static const struct inode_operations btrfs_symlink_inode_operations = { + .readlink = generic_readlink, +@@ -9573,8 +9559,8 @@ static const struct inode_operations btrfs_symlink_inode_operations = { + .getxattr = btrfs_getxattr, + .listxattr = btrfs_listxattr, + .removexattr = btrfs_removexattr, +- .update_time = btrfs_update_time, + .write_time = btrfs_write_time, ++ .is_readonly = btrfs_is_readonly, + }; + + const struct dentry_operations btrfs_dentry_operations = { +diff --git a/fs/inode.c b/fs/inode.c +index 1f90591..e83c6d2 100644 +--- a/fs/inode.c ++++ b/fs/inode.c +@@ -1555,20 +1555,20 @@ static int update_time(struct inode *inode, struct timespec *time, int flags) + unsigned short daycode; + int ret; + +- if (inode->i_op->update_time) { +- ret = inode->i_op->update_time(inode, time, flags); ++ if (inode->i_op->is_readonly) { ++ ret = inode->i_op->is_readonly(inode); + if (ret) + return ret; +- } else { +- if (flags & S_ATIME) +- inode->i_atime = *time; +- if (flags & S_VERSION) +- inode_inc_iversion(inode); +- if (flags & S_CTIME) +- inode->i_ctime = *time; +- if (flags & S_MTIME) +- inode->i_mtime = *time; + } ++ if (flags & S_ATIME) ++ inode->i_atime = *time; ++ if (flags & S_VERSION) ++ inode_inc_iversion(inode); ++ if (flags & S_CTIME) ++ inode->i_ctime = *time; ++ if (flags & S_MTIME) ++ inode->i_mtime = *time; ++ + /* + * If i_ts_dirty_day is zero, then either we have not deferred + * timestamp updates, or the system has been up for less than +diff --git a/include/linux/fs.h b/include/linux/fs.h +index dbbd642..70711c8 100644 +--- a/include/linux/fs.h ++++ b/include/linux/fs.h +@@ -1545,8 +1545,8 @@ struct inode_operations { + int (*removexattr) (struct dentry *, const char *); + int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, + u64 len); +- int (*update_time)(struct inode *, struct timespec *, int); + int (*write_time)(struct inode *); ++ int (*is_readonly)(struct inode *); + int (*atomic_open)(struct inode *, struct dentry *, + struct file *, unsigned open_flag, + umode_t create_mode, int *opened); diff --git a/dont-let-dirty-time-inodes-get-more-than-a-day-stale b/dont-let-dirty-time-inodes-get-more-than-a-day-stale index f7cf2f2c..9589b85a 100644 --- a/dont-let-dirty-time-inodes-get-more-than-a-day-stale +++ b/dont-let-dirty-time-inodes-get-more-than-a-day-stale @@ -6,9 +6,9 @@ stale. Signed-off-by: Theodore Ts'o --- fs/fs-writeback.c | 1 + - fs/inode.c | 16 +++++++++++++++- + fs/inode.c | 28 +++++++++++++++++++++++----- include/linux/fs.h | 1 + - 3 files changed, 17 insertions(+), 1 deletion(-) + 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index ce7de22..eb04277 100644 @@ -23,22 +23,25 @@ index ce7de22..eb04277 100644 sb->s_op->dirty_inode(inode, flags); diff --git a/fs/inode.c b/fs/inode.c -index 11fe81b..0d939a8 100644 +index 2093a84..34a443f 100644 --- a/fs/inode.c +++ b/fs/inode.c -@@ -1511,6 +1511,7 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, +@@ -1511,6 +1511,8 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, */ static int update_time(struct inode *inode, struct timespec *time, int flags) { -+ unsigned short days_since_boot = jiffies / (HZ * 86400); ++ struct timespec uptime; ++ unsigned short daycode; int ret; if (inode->i_op->update_time) { -@@ -1527,14 +1528,27 @@ static int update_time(struct inode *inode, struct timespec *time, int flags) +@@ -1525,17 +1527,33 @@ static int update_time(struct inode *inode, struct timespec *time, int flags) + if (flags & S_CTIME) + inode->i_ctime = *time; if (flags & S_MTIME) - inode->i_mtime = *time; +- inode->i_mtime = *time; ++ inode->i_mtime = *time; } -- if (inode->i_sb->s_flags & MS_LAZYTIME) { + /* + * If i_ts_dirty_day is zero, then either we have not deferred + * timestamp updates, or the system has been up for less than @@ -48,16 +51,24 @@ index 11fe81b..0d939a8 100644 + * different from days_since_boot, and then we should update + * the on-disk inode and then we can clear i_ts_dirty_day. + */ -+ if ((inode->i_sb->s_flags & MS_LAZYTIME) && -+ (!inode->i_ts_dirty_day || -+ inode->i_ts_dirty_day == days_since_boot)) { + if ((inode->i_sb->s_flags & MS_LAZYTIME) && + !(flags & S_VERSION)) { if (inode->i_state & I_DIRTY_TIME) return 0; - spin_lock(&inode->i_lock); - inode->i_state |= I_DIRTY_TIME; - spin_unlock(&inode->i_lock); -+ inode->i_ts_dirty_day = days_since_boot; - return 0; +- spin_lock(&inode->i_lock); +- inode->i_state |= I_DIRTY_TIME; +- spin_unlock(&inode->i_lock); +- return 0; ++ get_monotonic_boottime(&uptime); ++ daycode = div_u64(uptime.tv_sec, (HZ * 86400)); ++ if (!inode->i_ts_dirty_day || ++ inode->i_ts_dirty_day == daycode) { ++ spin_lock(&inode->i_lock); ++ inode->i_state |= I_DIRTY_TIME; ++ spin_unlock(&inode->i_lock); ++ inode->i_ts_dirty_day = daycode; ++ return 0; ++ } } + inode->i_ts_dirty_day = 0; if (inode->i_op->write_time) diff --git a/ext4-add-lazytime-mount-option b/ext4-add-lazytime-mount-option index 479553eb..f25c8773 100644 --- a/ext4-add-lazytime-mount-option +++ b/ext4-add-lazytime-mount-option @@ -18,8 +18,8 @@ Signed-off-by: Theodore Ts'o fs/ext4/super.c | 9 +++++++++ fs/inode.c | 36 ++++++++++++++++++++++++++++++++++++ include/linux/fs.h | 2 ++ - include/trace/events/ext4.h | 29 +++++++++++++++++++++++++++++ - 5 files changed, 121 insertions(+), 3 deletions(-) + include/trace/events/ext4.h | 30 ++++++++++++++++++++++++++++++ + 5 files changed, 122 insertions(+), 3 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 3356ab5..03149b4 100644 @@ -131,7 +131,7 @@ index 4b79f39..1ac1914 100644 for (m = ext4_mount_opts; m->token != Opt_err; m++) diff --git a/fs/inode.c b/fs/inode.c -index 5a9a7b0..17eb1c0 100644 +index 6319ead..1f90591 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1296,6 +1296,42 @@ struct inode *ilookup(struct super_block *sb, unsigned long ino) @@ -191,10 +191,10 @@ index e3574cd..dbbd642 100644 extern int insert_inode_locked(struct inode *); #ifdef CONFIG_DEBUG_LOCK_ALLOC diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h -index ff4bd1b..aca53c0 100644 +index ff4bd1b..ba649cb 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h -@@ -75,6 +75,35 @@ struct extent_status; +@@ -75,6 +75,36 @@ struct extent_status; { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"}) @@ -223,8 +223,9 @@ index ff4bd1b..aca53c0 100644 + + TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u", + MAJOR(__entry->dev), MINOR(__entry->dev), -+ (unsigned long) __entry->orig_ino, __entry->ino, -+ __entry->mode, __entry->uid, __entry->gid) ++ (unsigned long) __entry->orig_ino, ++ (unsigned long) __entry->ino, __entry->mode, ++ __entry->uid, __entry->gid) +); + TRACE_EVENT(ext4_free_inode, diff --git a/series b/series index 20c75e88..c6ea0884 100644 --- a/series +++ b/series @@ -2,17 +2,19 @@ move_extent-improve-bh-vanishing-success-factor kill-ext4_kvfree -split-update_time-into-update_time-and-write_time -vfs-add-lazytime-mount-option -dont-let-dirty-time-inodes-get-more-than-a-day-stale -add-lazytime-tracepoints -ext4-add-lazytime-mount-option fix-partial-cluster-initialization fix-end-of-leaf-partial-cluster-handling miscellaneous-partial-cluster-cleanups fix-end-of-region-partial-cluster-handling +split-update_time-into-update_time-and-write_time +vfs-add-lazytime-mount-option +dont-let-dirty-time-inodes-get-more-than-a-day-stale +add-lazytime-tracepoints +ext4-add-lazytime-mount-option +btrfs-drop-update_time + ########################################## # unstable patches #################################################### diff --git a/split-update_time-into-update_time-and-write_time b/split-update_time-into-update_time-and-write_time index 4c2f9845..b640b73f 100644 --- a/split-update_time-into-update_time-and-write_time +++ b/split-update_time-into-update_time-and-write_time @@ -12,12 +12,33 @@ Signed-off-by: Theodore Ts'o Cc: xfs@oss.sgi.com Cc: linux-btrfs@vger.kernel.org --- - fs/btrfs/inode.c | 10 ++++++++++ - fs/inode.c | 29 ++++++++++++++++++----------- - fs/xfs/xfs_iops.c | 39 ++++++++++++++++----------------------- - include/linux/fs.h | 1 + - 4 files changed, 45 insertions(+), 34 deletions(-) + Documentation/filesystems/Locking | 2 ++ + fs/btrfs/inode.c | 10 ++++++++++ + fs/inode.c | 29 ++++++++++++++++++----------- + fs/xfs/xfs_iops.c | 39 ++++++++++++++++----------------------- + include/linux/fs.h | 1 + + 5 files changed, 47 insertions(+), 34 deletions(-) +diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking +index b30753c..e49861d 100644 +--- a/Documentation/filesystems/Locking ++++ b/Documentation/filesystems/Locking +@@ -63,6 +63,7 @@ prototypes: + int (*removexattr) (struct dentry *, const char *); + int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); + void (*update_time)(struct inode *, struct timespec *, int); ++ void (*write_time)(struct inode *); + int (*atomic_open)(struct inode *, struct dentry *, + struct file *, unsigned open_flag, + umode_t create_mode, int *opened); +@@ -95,6 +96,7 @@ listxattr: no + removexattr: yes + fiemap: no + update_time: no ++write_time: no + atomic_open: yes + tmpfile: no + dentry_open: no diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d23362f..a5e0d0d 100644 --- a/fs/btrfs/inode.c diff --git a/timestamps b/timestamps index 5779f597..3f26c4b5 100755 --- a/timestamps +++ b/timestamps @@ -1,3 +1,6 @@ +touch -d @1289246085 use-discard-if-possible-in-blkdev_issue_zeroout +touch -d @1289862704 add-lazytime-mount-option +touch -d @1314736473 change-lru-to-round-rubin-in-extent-status-tree touch -d @1398102654 save-patch touch -d @1402323175 archive touch -d @1402890388 fix-buffer-double-free-in-ext4_alloc_branch @@ -10,6 +13,8 @@ touch -d @1410055965 move-read-page-functions-to-new-file touch -d @1410060348 include-mpage-functions-into-readpage.c touch -d @1410060352 inline-ext4_get_block-into-readpage touch -d @1410111565 dont-use-io-end-if-not-needed +touch -d @1410467342 akpm-jbd2-locking-fix +touch -d @1413721175 implement-the-ext4-encryption-write-path touch -d @1414970511 add-blkdiscard-ioctl touch -d @1414970571 block-dio-during-truncate touch -d @1414970631 delalloc-debug @@ -17,33 +22,29 @@ touch -d @1414970691 commit-as-soon-as-possible-after-log_start_commit touch -d @1414970751 add-sysfs-bool-support touch -d @1414970811 add-squelch-errors-support touch -d @1414970871 dump-in-use-buffers -touch -d @1414970931 akpm-jbd2-locking-fix touch -d @1415206358 move_extent-improve-bh-vanishing-success-factor touch -d @1415232136 add-fallocate-mode-blocking-for-debugging -touch -d @1415232137 use-discard-if-possible-in-blkdev_issue_zeroout -touch -d @1415765198 add-lazytime-mount-option touch -d @1416503951 kill-ext4_kvfree -touch -d @1416595828 split-update_time-into-update_time-and-write_time -touch -d @1416665009 vfs-add-lazytime-mount-option -touch -d @1416665091 dont-let-dirty-time-inodes-get-more-than-a-day-stale -touch -d @1416669345 add-lazytime-tracepoints -touch -d @1416669353 ext4-add-lazytime-mount-option -touch -d @1416669413 stable-boundary -touch -d @1416669473 stable-boundary-undo.patch +touch -d @1416669413 stable-boundary-undo.patch touch -d @1416669533 add-callback-support-for-bio-read-completion touch -d @1416669593 add-ext4-encryption-facilities -touch -d @1416669653 implement-the-ext4-encryption-write-path touch -d @1416669713 implement-the-ext4-decryption-read-path -touch -d @1416711762 cache-extent-hole-in-extent-status-tree-for-ext4_da_map_blocks -touch -d @1416715360 move-lru-list-handling-into-extent-status-code -touch -d @1416715744 change-lru-to-round-rubin-in-extent-status-tree -touch -d @1416715746 limit-number-of-scanned-extents-in-status-tree-shrinker -touch -d @1416715883 cleanup-flag-definitions-for-extent-status-tree -touch -d @1416716184 introduce-aging-to-extent-status-tree touch -d @1416722142 fix-partial-cluster-initialization touch -d @1416722291 fix-end-of-leaf-partial-cluster-handling touch -d @1416722379 miscellaneous-partial-cluster-cleanups touch -d @1416722619 fix-end-of-region-partial-cluster-handling -touch -d @1416722647 series -touch -d @1416773100 status -touch -d @1416792512 timestamps +touch -d @1416722679 cache-extent-hole-in-extent-status-tree-for-ext4_da_map_blocks +touch -d @1416722679 split-update_time-into-update_time-and-write_time +touch -d @1416722739 move-lru-list-handling-into-extent-status-code +touch -d @1416722859 limit-number-of-scanned-extents-in-status-tree-shrinker +touch -d @1416722919 cleanup-flag-definitions-for-extent-status-tree +touch -d @1416722979 introduce-aging-to-extent-status-tree +touch -d @1416890846 vfs-add-lazytime-mount-option +touch -d @1416890847 dont-let-dirty-time-inodes-get-more-than-a-day-stale +touch -d @1416890980 add-lazytime-tracepoints +touch -d @1416891093 ext4-add-lazytime-mount-option +touch -d @1416891659 series +touch -d @1416892137 btrfs-drop-update_time +touch -d @1416892150 stable-boundary +touch -d @1416892150 status +touch -d @1416892592 timestamps diff --git a/vfs-add-lazytime-mount-option b/vfs-add-lazytime-mount-option index 7eea054d..a2ecec55 100644 --- a/vfs-add-lazytime-mount-option +++ b/vfs-add-lazytime-mount-option @@ -24,12 +24,12 @@ Google-Bug-Id: 18297052 Signed-off-by: Theodore Ts'o --- fs/fs-writeback.c | 38 +++++++++++++++++++++++++++++++++++++- - fs/inode.c | 20 ++++++++++++++++++++ + fs/inode.c | 21 +++++++++++++++++++++ fs/proc_namespace.c | 1 + fs/sync.c | 7 +++++++ include/linux/fs.h | 1 + include/uapi/linux/fs.h | 1 + - 6 files changed, 67 insertions(+), 1 deletion(-) + 6 files changed, 68 insertions(+), 1 deletion(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index ef9bef1..ce7de22 100644 @@ -95,7 +95,7 @@ index ef9bef1..ce7de22 100644 wait_for_completion(&done); diff --git a/fs/inode.c b/fs/inode.c -index 8f5c4b5..11fe81b 100644 +index 8f5c4b5..2093a84 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -534,6 +534,18 @@ static void evict(struct inode *inode) @@ -117,11 +117,12 @@ index 8f5c4b5..11fe81b 100644 if (!list_empty(&inode->i_wb_list)) inode_wb_list_del(inode); -@@ -1515,6 +1527,14 @@ static int update_time(struct inode *inode, struct timespec *time, int flags) +@@ -1515,6 +1527,15 @@ static int update_time(struct inode *inode, struct timespec *time, int flags) if (flags & S_MTIME) inode->i_mtime = *time; } -+ if (inode->i_sb->s_flags & MS_LAZYTIME) { ++ if ((inode->i_sb->s_flags & MS_LAZYTIME) && ++ !(flags & S_VERSION)) { + if (inode->i_state & I_DIRTY_TIME) + return 0; + spin_lock(&inode->i_lock); @@ -145,7 +146,7 @@ index 73ca174..f98234a 100644 }; const struct proc_fs_info *fs_infop; diff --git a/fs/sync.c b/fs/sync.c -index bdc729d..db7930e 100644 +index bdc729d..3a35506a 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -177,8 +177,15 @@ SYSCALL_DEFINE1(syncfs, int, fd) @@ -156,7 +157,7 @@ index bdc729d..db7930e 100644 + if (!file->f_op->fsync) return -EINVAL; -+ if (!datasync && inode->i_state & I_DIRTY_TIME) { ++ if (!datasync && (inode->i_state & I_DIRTY_TIME)) { + spin_lock(&inode->i_lock); + inode->i_state |= I_DIRTY_SYNC; + spin_unlock(&inode->i_lock); -- 2.11.4.GIT