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: <20241014121427.vuebknsmdlrtbveh@quack3>
Date: Mon, 14 Oct 2024 14:14:27 +0200
From: Jan Kara <jack@...e.cz>
To: Kaixiong Yu <yukaixiong@...wei.com>
Cc: akpm@...ux-foundation.org, mcgrof@...nel.org,
	ysato@...rs.sourceforge.jp, dalias@...c.org,
	glaubitz@...sik.fu-berlin.de, luto@...nel.org, tglx@...utronix.de,
	mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
	hpa@...or.com, viro@...iv.linux.org.uk, brauner@...nel.org,
	jack@...e.cz, kees@...nel.org, j.granados@...sung.com,
	willy@...radead.org, Liam.Howlett@...cle.com, vbabka@...e.cz,
	lorenzo.stoakes@...cle.com, trondmy@...nel.org, anna@...nel.org,
	chuck.lever@...cle.com, jlayton@...nel.org, neilb@...e.de,
	okorniev@...hat.com, Dai.Ngo@...cle.com, tom@...pey.com,
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, paul@...l-moore.com, jmorris@...ei.org,
	linux-sh@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
	linux-nfs@...r.kernel.org, netdev@...r.kernel.org,
	linux-security-module@...r.kernel.org, dhowells@...hat.com,
	haifeng.xu@...pee.com, baolin.wang@...ux.alibaba.com,
	shikemeng@...weicloud.com, dchinner@...hat.com, bfoster@...hat.com,
	souravpanda@...gle.com, hannes@...xchg.org, rientjes@...gle.com,
	pasha.tatashin@...een.com, david@...hat.com, ryan.roberts@....com,
	ying.huang@...el.com, yang@...amperecomputing.com,
	zev@...ilderbeest.net, serge@...lyn.com, vegard.nossum@...cle.com,
	wangkefeng.wang@...wei.com, sunnanyong@...wei.com
Subject: Re: [PATCH v3 -next 09/15] fs: fs-writeback: move sysctl to
 fs/fs-writeback.c

On Thu 10-10-24 23:22:09, Kaixiong Yu wrote:
> The dirtytime_expire_interval belongs to fs/fs-writeback.c, move it to
> fs/fs-writeback.c from /kernel/sysctl.c. And remove the useless extern
> variable declaration and the function declaration from
> include/linux/writeback.h
> 
> Signed-off-by: Kaixiong Yu <yukaixiong@...wei.com>
> Reviewed-by: Kees Cook <kees@...nel.org>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
> v3:
>  - change dirtytime_expire_interval to static type
>  - change the title
> ---
>  fs/fs-writeback.c         | 30 +++++++++++++++++++++---------
>  include/linux/writeback.h |  4 ----
>  kernel/sysctl.c           |  8 --------
>  3 files changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index d8bec3c1bb1f..4fedefdb8e15 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -65,7 +65,7 @@ struct wb_writeback_work {
>   * timestamps written to disk after 12 hours, but in the worst case a
>   * few inodes might not their timestamps updated for 24 hours.
>   */
> -unsigned int dirtytime_expire_interval = 12 * 60 * 60;
> +static unsigned int dirtytime_expire_interval = 12 * 60 * 60;
>  
>  static inline struct inode *wb_inode(struct list_head *head)
>  {
> @@ -2413,14 +2413,7 @@ static void wakeup_dirtytime_writeback(struct work_struct *w)
>  	schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
>  }
>  
> -static int __init start_dirtytime_writeback(void)
> -{
> -	schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
> -	return 0;
> -}
> -__initcall(start_dirtytime_writeback);
> -
> -int dirtytime_interval_handler(const struct ctl_table *table, int write,
> +static int dirtytime_interval_handler(const struct ctl_table *table, int write,
>  			       void *buffer, size_t *lenp, loff_t *ppos)
>  {
>  	int ret;
> @@ -2431,6 +2424,25 @@ int dirtytime_interval_handler(const struct ctl_table *table, int write,
>  	return ret;
>  }
>  
> +static struct ctl_table vm_fs_writeback_table[] = {
> +	{
> +		.procname	= "dirtytime_expire_seconds",
> +		.data		= &dirtytime_expire_interval,
> +		.maxlen		= sizeof(dirtytime_expire_interval),
> +		.mode		= 0644,
> +		.proc_handler	= dirtytime_interval_handler,
> +		.extra1		= SYSCTL_ZERO,
> +	},
> +};
> +
> +static int __init start_dirtytime_writeback(void)
> +{
> +	schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
> +	register_sysctl_init("vm", vm_fs_writeback_table);
> +	return 0;
> +}
> +__initcall(start_dirtytime_writeback);
> +
>  /**
>   * __mark_inode_dirty -	internal function to mark an inode dirty
>   *
> diff --git a/include/linux/writeback.h b/include/linux/writeback.h
> index d6db822e4bb3..5f35b24aff7b 100644
> --- a/include/linux/writeback.h
> +++ b/include/linux/writeback.h
> @@ -351,12 +351,8 @@ extern struct wb_domain global_wb_domain;
>  /* These are exported to sysctl. */
>  extern unsigned int dirty_writeback_interval;
>  extern unsigned int dirty_expire_interval;
> -extern unsigned int dirtytime_expire_interval;
>  extern int laptop_mode;
>  
> -int dirtytime_interval_handler(const struct ctl_table *table, int write,
> -		void *buffer, size_t *lenp, loff_t *ppos);
> -
>  void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
>  unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh);
>  unsigned long cgwb_calc_thresh(struct bdi_writeback *wb);
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index d3de31ec74bf..373e018b950c 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -2024,14 +2024,6 @@ static struct ctl_table kern_table[] = {
>  };
>  
>  static struct ctl_table vm_table[] = {
> -	{
> -		.procname	= "dirtytime_expire_seconds",
> -		.data		= &dirtytime_expire_interval,
> -		.maxlen		= sizeof(dirtytime_expire_interval),
> -		.mode		= 0644,
> -		.proc_handler	= dirtytime_interval_handler,
> -		.extra1		= SYSCTL_ZERO,
> -	},
>  	{
>  		.procname	= "drop_caches",
>  		.data		= &sysctl_drop_caches,
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ