Re: [PATCH v2 29/34] bdev: make struct bdev_handle private to the block layer

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

 



On Thu 01-02-24 16:07:59, Christian Brauner wrote:
> > > +	if (ret)
> > > +		return ERR_PTR(ret);
> > > +
> > > +	bdev = blkdev_get_no_open(dev);
> > > +	if (!bdev)
> > > +		return ERR_PTR(-ENXIO);
> > >  
> > >  	flags = blk_to_file_flags(mode);
> > > -	bdev_file = alloc_file_pseudo_noaccount(handle->bdev->bd_inode,
> > > +	bdev_file = alloc_file_pseudo_noaccount(bdev->bd_inode,
> > >  			blockdev_mnt, "", flags | O_LARGEFILE, &def_blk_fops);
> > >  	if (IS_ERR(bdev_file)) {
> > > -		bdev_release(handle);
> > > +		blkdev_put_no_open(bdev);
> > >  		return bdev_file;
> > >  	}
> > > -	ihold(handle->bdev->bd_inode);
> > > +	bdev_file->f_mode &= ~FMODE_OPENED;
> > 
> > Hum, why do you need these games with FMODE_OPENED? I suspect you want to
> > influence fput() behavior but then AFAICT we will leak dentry, mnt, etc. on
> > error? If this is indeed needed, it deserves a comment...
> 
> I rewrote this.
> 
> Total diff I applied is:

Looks good now.

								Honza

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




[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