RE: [PATCH v2] hfsplus: remove mutex_lock check in hfsplus_free_extents

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

 



On Thu, 2025-05-29 at 19:36 +0100, Al Viro wrote:
> On Thu, May 29, 2025 at 06:34:43PM +0000, Viacheslav Dubeyko wrote:
> > > diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
> > > index a6d61685ae79..b1699b3c246a 100644
> > > --- a/fs/hfsplus/extents.c
> > > +++ b/fs/hfsplus/extents.c
> > > @@ -342,9 +342,6 @@ static int hfsplus_free_extents(struct super_block *sb,
> > >  	int i;
> > >  	int err = 0;
> > >  
> > > -	/* Mapping the allocation file may lock the extent tree */
> > > -	WARN_ON(mutex_is_locked(&HFSPLUS_SB(sb)->ext_tree->tree_lock));
> > > -
> > 
> > Makes sense to me. Looks good.
> > 
> > But I really like your mentioning of reproducing the issue in generic/013 and
> > really nice analysis of the issue there. Sadly, we haven't it in the comment. :)
> 
> Umm...  *Is* that thing safe to call without that lock?

As far as I can see, hfsplus_free_fork() works under ext_tree->tree_lock mutex
lock.
And hfsplus_free_extents() calls hfsplus_block_free(). This guy
uses sbi->alloc_mutex to protect free blocks operation. So, operation
should be mostly safe.

Thanks,
Slava.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux