Re: [PATCH v2 00/34] Open block devices as files

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

 



> > Can you double-check what's in vfs.super right now? I thought I fixed
> > this up. I'll check too!
> 
> Well, you've fixed the "double allocation" issue but there's still a
> problem that you do:
> 
> int bdev_open(struct block_device *bdev, blk_mode_t mode, void *holder,
> 	      const struct blk_holder_ops *hops, struct file *bdev_file)
> {
> ...
> 	handle = kmalloc(sizeof(struct bdev_handle), GFP_KERNEL);
> 	if (!handle)
> 		return -ENOMEM;
>  	if (holder) {
>  		mode |= BLK_OPEN_EXCL;
>  		ret = bd_prepare_to_claim(bdev, holder, hops);
>  		if (ret)
> 			return ret;
>  	} else {
> ...
> 
> 
> So in case bd_prepare_to_claim() fails we forget to free the allocated
> handle.

Grumble grumble grumble, thank you! Fixing.




[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