From 6d46d2934aeab54bd560e68bf5c73f016f9317a2 Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Tue, 9 Apr 2019 18:37:52 +0800 Subject: [PATCH 1/6] fs/block_dev.c: remove unused include Just remove unused include from fs/block_dev.c. Signed-off-by: Chengguang Xu Reviewed-by: Bart Van Assche Signed-off-by: Al Viro --- fs/block_dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 78d3257435c0..6b584817d461 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include From 6f22b6649edf11334b558185c209bb7ba9a9ee28 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 26 Apr 2019 16:50:41 +0200 Subject: [PATCH 2/6] fs: use timespec64 in relatime_need_update For some reason, the conversion of the VFS code away from 'struct timespec' left one function behind that still uses it, for absolutely no reason. Using timespec64 will make the atime update logic work correctly past y2038. Signed-off-by: Arnd Bergmann Signed-off-by: Al Viro --- fs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index e9d97add2b36..f8ed7144c3dd 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1601,7 +1601,7 @@ EXPORT_SYMBOL(bmap); * passed since the last atime update. */ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, - struct timespec now) + struct timespec64 now) { if (!(mnt->mnt_flags & MNT_RELATIME)) @@ -1702,7 +1702,7 @@ bool atime_needs_update(const struct path *path, struct inode *inode) now = current_time(inode); - if (!relatime_need_update(mnt, inode, timespec64_to_timespec(now))) + if (!relatime_need_update(mnt, inode, now)) return false; if (timespec64_equal(&inode->i_atime, &now)) From c59a89972258102e7d22cda5927e6c8121d84f26 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 11 Apr 2019 16:16:27 -0700 Subject: [PATCH 3/6] Documentation/filesystems/vfs.txt: remove bogus "Last updated" date This file has actually been updated over 100 times since the claimed "Last updated" date. Signed-off-by: Eric Biggers Signed-off-by: Al Viro --- Documentation/filesystems/vfs.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 761c6fd24a53..33120f220f86 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt @@ -3,8 +3,6 @@ Original author: Richard Gooch - Last updated on June 24, 2007. - Copyright (C) 1999 Richard Gooch Copyright (C) 2005 Pekka Enberg From dcb2cb1f26f91df486492e2f2c2d62fe751fd21a Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 11 Apr 2019 16:16:28 -0700 Subject: [PATCH 4/6] Documentation/filesystems/vfs.txt: document how ->i_link works Signed-off-by: Eric Biggers Signed-off-by: Al Viro --- Documentation/filesystems/vfs.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 33120f220f86..57fc576b1f3e 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt @@ -463,6 +463,12 @@ otherwise noted. argument. If request can't be handled without leaving RCU mode, have it return ERR_PTR(-ECHILD). + If the filesystem stores the symlink target in ->i_link, the + VFS may use it directly without calling ->get_link(); however, + ->get_link() must still be provided. ->i_link must not be + freed until after an RCU grace period. Writing to ->i_link + post-iget() time requires a 'release' memory barrier. + readlink: this is now just an override for use by readlink(2) for the cases when ->get_link uses nd_jump_link() or object is not in fact a symlink. Normally filesystems should only implement From 1a6a31655071106a34ae06353390891a80c54371 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 11 Apr 2019 16:16:29 -0700 Subject: [PATCH 5/6] Documentation/filesystems/Locking: fix ->get_link() prototype Signed-off-by: Eric Biggers Signed-off-by: Al Viro --- Documentation/filesystems/Locking | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index efea228ccd8a..428455bf9c97 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@ -52,7 +52,7 @@ prototypes: int (*rename) (struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int); - const char *(*get_link) (struct dentry *, struct inode *, void **); + const char *(*get_link) (struct dentry *, struct inode *, struct delayed_call *); void (*truncate) (struct inode *); int (*permission) (struct inode *, int, unsigned int); int (*get_acl)(struct inode *, int); From 6ee9706aa22e026f438caabb2982e5f78de2c82c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 11 Apr 2019 16:16:30 -0700 Subject: [PATCH 6/6] libfs: document simple_get_link() Signed-off-by: Eric Biggers Signed-off-by: Al Viro --- fs/libfs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fs/libfs.c b/fs/libfs.c index 0fb590d79f30..5f74a9872974 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -1167,6 +1167,20 @@ simple_nosetlease(struct file *filp, long arg, struct file_lock **flp, } EXPORT_SYMBOL(simple_nosetlease); +/** + * simple_get_link - generic helper to get the target of "fast" symlinks + * @dentry: not used here + * @inode: the symlink inode + * @done: not used here + * + * Generic helper for filesystems to use for symlink inodes where a pointer to + * the symlink target is stored in ->i_link. NOTE: this isn't normally called, + * since as an optimization the path lookup code uses any non-NULL ->i_link + * directly, without calling ->get_link(). But ->get_link() still must be set, + * to mark the inode_operations as being for a symlink. + * + * Return: the symlink target + */ const char *simple_get_link(struct dentry *dentry, struct inode *inode, struct delayed_call *done) {