lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <001be2e1-995c-d5d9-734f-06f75c702b42@redhat.com>
Date:   Tue, 9 Mar 2021 17:26:18 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Christoph Hellwig <hch@....de>, Al Viro <viro@...iv.linux.org.uk>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Daniel Vetter <daniel@...ll.ch>, Nadav Amit <namit@...are.com>,
        "VMware, Inc." <pv-drivers@...are.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Minchan Kim <minchan@...nel.org>,
        Nitin Gupta <ngupta@...are.org>,
        Jason Gunthorpe <jgg@...dia.com>,
        Alex Williamson <alex.williamson@...hat.com>,
        linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org,
        virtualization@...ts.linux-foundation.org,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 3/9] powerpc/pseries: remove the ppc-cmm file system

On 09.03.21 16:53, Christoph Hellwig wrote:
> Just use the generic anon_inode file system.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
>   arch/powerpc/platforms/pseries/cmm.c | 27 ++-------------------------
>   1 file changed, 2 insertions(+), 25 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
> index 6d36b858b14df1..9d07e6bea7126c 100644
> --- a/arch/powerpc/platforms/pseries/cmm.c
> +++ b/arch/powerpc/platforms/pseries/cmm.c
> @@ -6,6 +6,7 @@
>    * Author(s): Brian King (brking@...ux.vnet.ibm.com),
>    */
>   
> +#include <linux/anon_inodes.h>
>   #include <linux/ctype.h>
>   #include <linux/delay.h>
>   #include <linux/errno.h>
> @@ -502,19 +503,6 @@ static struct notifier_block cmm_mem_nb = {
>   };
>   
>   #ifdef CONFIG_BALLOON_COMPACTION
> -static struct vfsmount *balloon_mnt;
> -
> -static int cmm_init_fs_context(struct fs_context *fc)
> -{
> -	return init_pseudo(fc, PPC_CMM_MAGIC) ? 0 : -ENOMEM;
> -}
> -
> -static struct file_system_type balloon_fs = {
> -	.name = "ppc-cmm",
> -	.init_fs_context = cmm_init_fs_context,
> -	.kill_sb = kill_anon_super,
> -};
> -
>   static int cmm_migratepage(struct balloon_dev_info *b_dev_info,
>   			   struct page *newpage, struct page *page,
>   			   enum migrate_mode mode)
> @@ -573,19 +561,10 @@ static int cmm_balloon_compaction_init(void)
>   	balloon_devinfo_init(&b_dev_info);
>   	b_dev_info.migratepage = cmm_migratepage;
>   
> -	balloon_mnt = kern_mount(&balloon_fs);
> -	if (IS_ERR(balloon_mnt)) {
> -		rc = PTR_ERR(balloon_mnt);
> -		balloon_mnt = NULL;
> -		return rc;
> -	}
> -
> -	b_dev_info.inode = alloc_anon_inode_sb(balloon_mnt->mnt_sb);
> +	b_dev_info.inode = alloc_anon_inode();
>   	if (IS_ERR(b_dev_info.inode)) {
>   		rc = PTR_ERR(b_dev_info.inode);
>   		b_dev_info.inode = NULL;
> -		kern_unmount(balloon_mnt);
> -		balloon_mnt = NULL;
>   		return rc;
>   	}
>   
> @@ -597,8 +576,6 @@ static void cmm_balloon_compaction_deinit(void)
>   	if (b_dev_info.inode)
>   		iput(b_dev_info.inode);
>   	b_dev_info.inode = NULL;
> -	kern_unmount(balloon_mnt);
> -	balloon_mnt = NULL;
>   }
>   #else /* CONFIG_BALLOON_COMPACTION */
>   static int cmm_balloon_compaction_init(void)
> 

I always wondered why that was necessary after all (with my limited fs 
knowledge :) ).

a) I assume you want to remove PPC_CMM_MAGIC from 
include/uapi/linux/magic.h as well?

b) Do we still need #include <linux/magic.h>, #include <linux/mount.h> 
and #include <linux/pseudo_fs.h>?

Apart from that looks much cleaner.

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ