linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/17] clean up readlinks
@ 2016-09-12 19:29 Miklos Szeredi
  2016-09-12 19:29 ` [PATCH 01/17] bad_inode: add missing i_op initializers Miklos Szeredi
                   ` (17 more replies)
  0 siblings, 18 replies; 22+ messages in thread
From: Miklos Szeredi @ 2016-09-12 19:29 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel, Al Viro, David Howells, Tyler Hicks

The first patch is actually a bug fix, but I put it into this bunch for
simplicity...

The rest are really cleanups as well as minor bugfixes that are byproducts
of the cleanups.

This series builds on the fact that i_op.readlink is already set to
generic_readlink() in 43/50 of the cases.  And of those 7 only 4 are doing
something special.  So more than 90% of readlinks are/could actually just
call back into get_link.

The interesting cases are:

 - AFS, which has readlink but not get_link
 - proc, that allow jumping while following symlinks

The first is handled by setting IOP_NOFOLLOW on the inode by the fs.

The second one is handled by introducing is_following_link() which returns
a bool depending on whether current->nameidata is NULL or not.  If it
returns false ->get_link() should behave as ->readlink() did.  Otherwise it
should behave as id did previously.

Builds and boots.  Can even read symlinks.

Git tree is here:

  git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git readlink

Thanks,
Miklos
---

Miklos Szeredi (17):
  bad_inode: add missing i_op initializers
  ovl: use generic_readlink
  proc/self: use generic_readlink
  afs: use generic_readlink
  bad_inode: use generic_readlink
  vfs: remove page_readlink()
  vfs: add is_following_link() helper
  proc: merge proc_pid_readlink() into proc_pid_get_link()
  proc: merge proc_ns_readlink() into proc_ns_get_link()
  nsfs: clean up ns_get_name() interface
  vfs: replace calling i_op->readlink with vfs_readlink()
  vfs: remove ".readlink = generic_readlink" assignments
  vfs: remove unused i_op->readlink
  vfs: remove unused generic_readlink()
  vfs: add vfs_get_link() helper
  ovl: use vfs_get_link()
  ecryptfs: use vfs_get_link()

 Documentation/filesystems/Locking             |  2 -
 Documentation/filesystems/porting             | 15 +++++
 Documentation/filesystems/vfs.txt             | 25 ++++----
 drivers/staging/lustre/lustre/llite/symlink.c |  1 -
 fs/9p/vfs_inode.c                             |  1 -
 fs/9p/vfs_inode_dotl.c                        |  1 -
 fs/affs/symlink.c                             |  1 -
 fs/afs/inode.c                                |  2 +
 fs/afs/mntpt.c                                |  2 +-
 fs/autofs4/symlink.c                          |  1 -
 fs/bad_inode.c                                | 62 ++++++++++++++++----
 fs/btrfs/inode.c                              |  1 -
 fs/ceph/inode.c                               |  1 -
 fs/cifs/cifsfs.c                              |  1 -
 fs/coda/cnode.c                               |  1 -
 fs/configfs/symlink.c                         |  1 -
 fs/ecryptfs/inode.c                           | 30 ++++------
 fs/ext2/symlink.c                             |  2 -
 fs/ext4/symlink.c                             |  3 -
 fs/f2fs/namei.c                               |  2 -
 fs/fuse/dir.c                                 |  1 -
 fs/gfs2/inode.c                               |  1 -
 fs/hostfs/hostfs_kern.c                       |  1 -
 fs/jffs2/symlink.c                            |  1 -
 fs/jfs/symlink.c                              |  2 -
 fs/kernfs/symlink.c                           |  1 -
 fs/libfs.c                                    |  1 -
 fs/minix/inode.c                              |  1 -
 fs/namei.c                                    | 82 ++++++++++++++++++++-------
 fs/ncpfs/inode.c                              |  1 -
 fs/nfs/symlink.c                              |  1 -
 fs/nfsd/nfs4xdr.c                             |  8 +--
 fs/nfsd/vfs.c                                 |  4 +-
 fs/nilfs2/namei.c                             |  1 -
 fs/nsfs.c                                     | 17 ++++--
 fs/ocfs2/symlink.c                            |  1 -
 fs/orangefs/symlink.c                         |  1 -
 fs/overlayfs/copy_up.c                        | 46 ++-------------
 fs/overlayfs/inode.c                          | 25 +-------
 fs/proc/base.c                                | 66 +++++++--------------
 fs/proc/inode.c                               |  1 -
 fs/proc/namespaces.c                          | 41 +++++---------
 fs/proc/self.c                                | 13 -----
 fs/proc/thread_self.c                         | 14 -----
 fs/reiserfs/namei.c                           |  1 -
 fs/squashfs/symlink.c                         |  1 -
 fs/stat.c                                     |  5 +-
 fs/sysv/inode.c                               |  1 -
 fs/ubifs/file.c                               |  1 -
 fs/xfs/xfs_ioctl.c                            |  4 +-
 fs/xfs/xfs_iops.c                             |  2 -
 include/linux/fs.h                            |  9 ++-
 include/linux/namei.h                         |  1 +
 include/linux/proc_ns.h                       |  4 +-
 mm/shmem.c                                    |  2 -
 55 files changed, 226 insertions(+), 291 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-09-28 14:47 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-12 19:29 [PATCH 00/17] clean up readlinks Miklos Szeredi
2016-09-12 19:29 ` [PATCH 01/17] bad_inode: add missing i_op initializers Miklos Szeredi
2016-09-12 19:29 ` [PATCH 02/17] ovl: use generic_readlink Miklos Szeredi
2016-09-12 19:29 ` [PATCH 03/17] proc/self: " Miklos Szeredi
2016-09-12 19:29 ` [PATCH 04/17] afs: " Miklos Szeredi
2016-09-12 19:29 ` [PATCH 05/17] bad_inode: " Miklos Szeredi
2016-09-12 19:29 ` [PATCH 06/17] vfs: remove page_readlink() Miklos Szeredi
2016-09-12 19:29 ` [PATCH 07/17] vfs: add is_following_link() helper Miklos Szeredi
2016-09-12 19:29 ` [PATCH 08/17] proc: merge proc_pid_readlink() into proc_pid_get_link() Miklos Szeredi
2016-09-12 19:29 ` [PATCH 09/17] proc: merge proc_ns_readlink() into proc_ns_get_link() Miklos Szeredi
2016-09-12 19:29 ` [PATCH 10/17] nsfs: clean up ns_get_name() interface Miklos Szeredi
2016-09-12 19:29 ` [PATCH 11/17] vfs: replace calling i_op->readlink with vfs_readlink() Miklos Szeredi
2016-09-12 19:29 ` [PATCH 12/17] vfs: remove ".readlink = generic_readlink" assignments Miklos Szeredi
2016-09-12 19:29 ` [PATCH 13/17] vfs: remove unused i_op->readlink Miklos Szeredi
2016-09-12 19:29 ` [PATCH 14/17] vfs: remove unused generic_readlink() Miklos Szeredi
2016-09-12 19:29 ` [PATCH 15/17] vfs: add vfs_get_link() helper Miklos Szeredi
2016-09-12 19:29 ` [PATCH 16/17] ovl: use vfs_get_link() Miklos Szeredi
2016-09-12 19:29 ` [PATCH 17/17] ecryptfs: " Miklos Szeredi
2016-09-27  3:10 ` [PATCH 00/17] clean up readlinks Al Viro
2016-09-27  9:38   ` Miklos Szeredi
2016-09-28  2:17     ` Al Viro
2016-09-28 14:47       ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).