Re: [RFC 1/4] bdev: replace export of blockdev_superblock with BDEVFS_MAGIC

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

 



On Wed, Jun 07, 2023 at 08:24:01PM -0700, Luis Chamberlain wrote:
> -extern struct super_block *blockdev_superblock;
>  static inline bool sb_is_blkdev_sb(struct super_block *sb)
>  {
> -	return IS_ENABLED(CONFIG_BLOCK) && sb == blockdev_superblock;
> +	return IS_ENABLED(CONFIG_BLOCK) && sb->s_magic == BDEVFS_MAGIC;
>  }

So while I'd love to be able to make blockdev_superblock, I think
the existing code is the better idea here.  BDEVFS_MAGIC can easily
end up in any other s_magic as it's a free-form field.
blockdev_superblock can't accidentally have the same address as a
random non-bdev sb.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux