Re: [PATCH v4 1/6] kernfs: Acquire kernfs_rwsem in kernfs_notify_workfn().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Fri, Jan 24, 2025 at 06:46:09PM +0100, Sebastian Andrzej Siewior wrote:
> @@ -911,6 +911,7 @@ static void kernfs_notify_workfn(struct work_struct *work)
>  	/* kick fsnotify */
>  
>  	down_read(&root->kernfs_supers_rwsem);
> +	down_read(&root->kernfs_rwsem);
>  	list_for_each_entry(info, &kernfs_root(kn)->supers, node) {
>  		struct kernfs_node *parent;
>  		struct inode *p_inode = NULL;
> @@ -948,6 +949,7 @@ static void kernfs_notify_workfn(struct work_struct *work)
>  	}
>  
>  	up_read(&root->kernfs_supers_rwsem);
> +	up_read(&root->kernfs_rwsem);
>  	kernfs_put(kn);
>  	goto repeat;

Maybe match the locking and unlocking order so that what's locked last is
unlocked first? Other than that,

 Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

-- 
tejun




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux