* [patch] vfs: no "(unreachable)" prefix for SYSVIPC maps in /proc/PID/maps
@ 2009-09-07 15:21 Miklos Szeredi
2009-09-08 18:04 ` Hugh Dickins
2009-09-09 21:24 ` Andrew Morton
0 siblings, 2 replies; 4+ messages in thread
From: Miklos Szeredi @ 2009-09-07 15:21 UTC (permalink / raw)
To: akpm
Cc: Valdis.Kletnieks, hugh.dickins, matthew, agruen, viro, hch, linux-kernel
Another fix for vfs-fix-d_path-for-unreachable-paths.patch in -mm.
----
From: Miklos Szeredi <mszeredi@suse.cz>
The patch
"vfs: fix d_path() for unreachable paths"
generally changed d_path() to report unreachable paths with a special
prefix. This has an effect on /proc/${PID}/maps as well for memory
maps set up with shmem_file_setup() or hugetlb_file_setup(). These
functions set up unlinked files under a kernel-private vfsmount.
Since this vfsmount is unreachable from userspace, these maps will be
reported with the "(unreachable)" prefix.
This is undesirable, because it changes the kernel ABI and might break
applications for no good reason.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
fs/hugetlbfs/inode.c | 17 +++++++++++++++++
mm/shmem.c | 17 +++++++++++++++++
2 files changed, 34 insertions(+)
Index: linux-2.6/mm/shmem.c
===================================================================
--- linux-2.6.orig/mm/shmem.c 2009-09-07 16:27:57.000000000 +0200
+++ linux-2.6/mm/shmem.c 2009-09-07 16:46:41.000000000 +0200
@@ -2602,6 +2602,21 @@ int shmem_unuse(swp_entry_t entry, struc
/* common code */
+/*
+ * Do a special d_dname function so that these are not prefixed by
+ * "(unreachable)".
+ */
+static char *shmem_unlinked_d_dname(struct dentry *dentry, char *buf,
+ int buflen)
+{
+ return dynamic_dname(dentry, buf, buflen, "/%s (deleted)",
+ dentry->d_name.name);
+}
+
+static struct dentry_operations shmem_unlinked_dentry_operations = {
+ .d_dname = shmem_unlinked_d_dname,
+};
+
/**
* shmem_file_setup - get an unlinked file living in tmpfs
* @name: name for dentry (to be seen in /proc/<pid>/maps
@@ -2634,6 +2649,8 @@ struct file *shmem_file_setup(const char
if (!dentry)
goto put_memory;
+ dentry->d_op = &shmem_unlinked_dentry_operations;
+
error = -ENFILE;
file = get_empty_filp();
if (!file)
Index: linux-2.6/fs/hugetlbfs/inode.c
===================================================================
--- linux-2.6.orig/fs/hugetlbfs/inode.c 2009-09-07 16:27:57.000000000 +0200
+++ linux-2.6/fs/hugetlbfs/inode.c 2009-09-07 16:46:51.000000000 +0200
@@ -930,6 +930,21 @@ static struct file_system_type hugetlbfs
static struct vfsmount *hugetlbfs_vfsmount;
+/*
+ * Do a special d_dname function so that these are not prefixed by
+ * "(unreachable)".
+ */
+static char *hugetlb_unlinked_d_dname(struct dentry *dentry, char *buf,
+ int buflen)
+{
+ return dynamic_dname(dentry, buf, buflen, "/%s (deleted)",
+ dentry->d_name.name);
+}
+
+static struct dentry_operations hugetlb_unlinked_dentry_operations = {
+ .d_dname = hugetlb_unlinked_d_dname,
+};
+
static int can_do_hugetlb_shm(void)
{
return capable(CAP_IPC_LOCK) || in_group_p(sysctl_hugetlb_shm_group);
@@ -967,6 +982,8 @@ struct file *hugetlb_file_setup(const ch
if (!dentry)
goto out_shm_unlock;
+ dentry->d_op = &hugetlb_unlinked_dentry_operations;
+
error = -ENOSPC;
inode = hugetlbfs_get_inode(root->d_sb, current_fsuid(),
current_fsgid(), S_IFREG | S_IRWXUGO, 0);
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] vfs: no "(unreachable)" prefix for SYSVIPC maps in /proc/PID/maps
2009-09-07 15:21 [patch] vfs: no "(unreachable)" prefix for SYSVIPC maps in /proc/PID/maps Miklos Szeredi
@ 2009-09-08 18:04 ` Hugh Dickins
2009-09-09 21:24 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Hugh Dickins @ 2009-09-08 18:04 UTC (permalink / raw)
To: Miklos Szeredi
Cc: akpm, Valdis.Kletnieks, matthew, agruen, viro, hch, linux-kernel
On Mon, 7 Sep 2009, Miklos Szeredi wrote:
> Another fix for vfs-fix-d_path-for-unreachable-paths.patch in -mm.
>
> ----
> From: Miklos Szeredi <mszeredi@suse.cz>
>
> The patch
>
> "vfs: fix d_path() for unreachable paths"
>
> generally changed d_path() to report unreachable paths with a special
> prefix. This has an effect on /proc/${PID}/maps as well for memory
> maps set up with shmem_file_setup() or hugetlb_file_setup(). These
> functions set up unlinked files under a kernel-private vfsmount.
> Since this vfsmount is unreachable from userspace, these maps will be
> reported with the "(unreachable)" prefix.
>
> This is undesirable, because it changes the kernel ABI and might break
> applications for no good reason.
>
> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
> ---
> fs/hugetlbfs/inode.c | 17 +++++++++++++++++
> mm/shmem.c | 17 +++++++++++++++++
> 2 files changed, 34 insertions(+)
You can add my
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
to this and to the preceding two patches.
And give yourself a gold star for putting your updates into the right
section of mm/shmem.c, to cover both CONFIG_SHMEM=y and not set.
My heart sinks a little with these patches, particularly this
last; but I bet your heart sank a little to have to do them, and
I reluctantly agree with you that they're all probably necessary.
They do as you've said - I checked again with the 10.3 gnome-vfs.
Thanks,
Hugh
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] vfs: no "(unreachable)" prefix for SYSVIPC maps in /proc/PID/maps
2009-09-07 15:21 [patch] vfs: no "(unreachable)" prefix for SYSVIPC maps in /proc/PID/maps Miklos Szeredi
2009-09-08 18:04 ` Hugh Dickins
@ 2009-09-09 21:24 ` Andrew Morton
2009-09-10 5:43 ` Miklos Szeredi
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2009-09-09 21:24 UTC (permalink / raw)
To: Miklos Szeredi
Cc: Valdis.Kletnieks, hugh.dickins, matthew, agruen, viro, hch, linux-kernel
On Mon, 07 Sep 2009 17:21:49 +0200
Miklos Szeredi <miklos@szeredi.hu> wrote:
> Another fix for vfs-fix-d_path-for-unreachable-paths.patch in -mm.
>
Now I'm confused.
> From: Miklos Szeredi <mszeredi@suse.cz>
>
> The patch
>
> "vfs: fix d_path() for unreachable paths"
>
> generally changed d_path() to report unreachable paths with a special
> prefix. This has an effect on /proc/${PID}/maps as well for memory
> maps set up with shmem_file_setup() or hugetlb_file_setup(). These
> functions set up unlinked files under a kernel-private vfsmount.
> Since this vfsmount is unreachable from userspace, these maps will be
> reported with the "(unreachable)" prefix.
>
> This is undesirable, because it changes the kernel ABI and might break
> applications for no good reason.
>
> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
These three patches are fixes against
vfs-fix-d_path-for-unreachable-paths.patch? The description for
seq_file-return-a-negative-error-code-when-seq_path_root-fails.patch
led me to believe that vfs-fix-d_path-for-unreachable-paths.patch was
to be dropped.
argh.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] vfs: no "(unreachable)" prefix for SYSVIPC maps in /proc/PID/maps
2009-09-09 21:24 ` Andrew Morton
@ 2009-09-10 5:43 ` Miklos Szeredi
0 siblings, 0 replies; 4+ messages in thread
From: Miklos Szeredi @ 2009-09-10 5:43 UTC (permalink / raw)
To: akpm
Cc: miklos, Valdis.Kletnieks, hugh.dickins, matthew, agruen, viro,
hch, linux-kernel
On Wed, 9 Sep 2009, Andrew Morton wrote:
> On Mon, 07 Sep 2009 17:21:49 +0200
> Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> > Another fix for vfs-fix-d_path-for-unreachable-paths.patch in -mm.
> >
>
> Now I'm confused.
>
> > From: Miklos Szeredi <mszeredi@suse.cz>
> >
> > The patch
> >
> > "vfs: fix d_path() for unreachable paths"
> >
> > generally changed d_path() to report unreachable paths with a special
> > prefix. This has an effect on /proc/${PID}/maps as well for memory
> > maps set up with shmem_file_setup() or hugetlb_file_setup(). These
> > functions set up unlinked files under a kernel-private vfsmount.
> > Since this vfsmount is unreachable from userspace, these maps will be
> > reported with the "(unreachable)" prefix.
> >
> > This is undesirable, because it changes the kernel ABI and might break
> > applications for no good reason.
> >
> > Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
>
> These three patches are fixes against
> vfs-fix-d_path-for-unreachable-paths.patch?
Yes. They apply even without that patch, but don't make any sense...
Sorry about the confusion :(
Thanks,
Miklos
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-09-10 5:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-07 15:21 [patch] vfs: no "(unreachable)" prefix for SYSVIPC maps in /proc/PID/maps Miklos Szeredi
2009-09-08 18:04 ` Hugh Dickins
2009-09-09 21:24 ` Andrew Morton
2009-09-10 5:43 ` Miklos Szeredi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®