Re: [PATCH 5/5] ext4: Improve scalability of ext4 orphan file handling

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

 



On Wed, Aug 11, 2021 at 12:19:15PM +0200, Jan Kara wrote:
> diff --git a/fs/ext4/orphan.c b/fs/ext4/orphan.c
> index 019719c0ac12..18622ddeb41b 100644
> --- a/fs/ext4/orphan.c
> +++ b/fs/ext4/orphan.c
> @@ -28,28 +43,40 @@ static int ext4_orphan_file_add(handle_t *handle, struct inode *inode)
>  		 */
>  		return -ENOSPC;
>  	}
> -	oi->of_binfo[i].ob_free_entries--;
> -	spin_unlock(&oi->of_lock);
>  
> -	/*
> -	 * Get access to orphan block. We have dropped of_lock but since we
> -	 * have decremented number of free entries we are guaranteed free entry
> -	 * in our block.
> -	 */
>  	ret = ext4_journal_get_write_access(handle, inode->i_sb,
>  				oi->of_binfo[i].ob_bh, EXT4_JTR_ORPHAN_FILE);
>  	if (ret)
>  		return ret;

Shouldn't there be a call to:

		atomic_inc(&oi->of_binfo[i].ob_free_entries);

before we return, so the free_entry count stays consistent?

Otherwise, with the test-bot comments also addressed, you can add:

Reviewed-by: Theodore Ts'o <tytso@xxxxxxx>

Thanks,


       	  	     	 	    	  - Ted



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux