Re: [PATCH] hfsplus: don't use BUG_ON() in hfsplus_create_attributes_file()

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

 



On 2025/07/10 3:33, Viacheslav Dubeyko wrote:
> My worry that we could have a race condition here. Let's imagine that two
> threads are trying to call __hfsplus_setxattr() and both will try to create the
> Attributes File. Potentially, we could end in situation when inode could have
> not zero size during hfsplus_create_attributes_file() in one thread because
> another thread in the middle of Attributes File creation. Could we double check
> that we don't have the race condition here? Otherwise, we need to make much
> cleaner fix of this issue.

I think that there is some sort of race window, for
https://elixir.bootlin.com/linux/v6.15.5/source/fs/hfsplus/xattr.c#L145
explains that if more than one thread concurrently reached

	if (!HFSPLUS_SB(inode->i_sb)->attr_tree) {
		err = hfsplus_create_attributes_file(inode->i_sb);
		if (unlikely(err))
			goto end_setxattr;
	}

path, all threads except one thread will fail with -EAGAIN.





[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