Re: [PATCH V2] fs: don't scan the inode cache before SB_BORN is set

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

 



On Tue, Mar 27, 2018 at 05:57:56PM +1100, Dave Chinner wrote:
>  	 */
> +	smp_rmb();
> +	if (!(sb->s_flags & SB_BORN))
> +		return 0;
> +
>  	if (sb->s_op && sb->s_op->nr_cached_objects)
>  		total_objects = sb->s_op->nr_cached_objects(sb, sc);
>  
> @@ -1227,7 +1237,13 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
>  	sb = root->d_sb;
>  	BUG_ON(!sb);
>  	WARN_ON(!sb->s_bdi);
> +
> +	/*
> +	 * Write barrier is for super_cache_count() to ensure it does not run
> +	 * until after the superblock is fully set up.
> +	 */
>  	sb->s_flags |= SB_BORN;
> +	smp_wmb();


Umm...  OK, I'm nearly asleep right now, but... shouldn't that be

	if (check ->s_flags)
		bugger off
	smp_rmb();
	loads
vs.
	stores
	smp_wmb();
	store ->s_flags?

IOW, your barriers seem to be in the wrong places...



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

  Powered by Linux