Re: [PATCH 02/32] block: Use file->f_flags for determining exclusive opens in file_to_blk_mode()

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

 



On Thu 06-07-23 08:35:23, Christoph Hellwig wrote:
> On Tue, Jul 04, 2023 at 02:21:29PM +0200, Jan Kara wrote:
> > Use file->f_flags instead of file->private_data for determining whether
> > we should set BLK_OPEN_EXCL flag. This allows us to remove somewhat
> > awkward setting of file->private_data before calling file_to_blk_mode()
> > and it also makes following conversion to blkdev_get_handle_by_dev()
> > simpler.
> 
> While this looks a lot nicer, I don't think it actually works given that
> do_dentry_open clears out O_EXCL, and thus it won't be set when
> calling into blkdev_ioctl.

Aha, good point! So I need to workaround this a bit differently. I think
the best would be to have file_to_blk_mode() for blkdev_open() only and
make the other places (which already have bdev_handle available from
struct file) use bdev_handle->mode. But I have to come up with a sane
transition to that state :).

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[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