Re: [PATCH 04/10 V2] fibmap: Use bmap instead of ->bmap method in ioctl_fibmap

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

 



Hi Christoph. Sorry for the delayed reply.

> > +	error = get_user(usr_blk, p);
> > +	if (error)
> > +		return error;
> 
> Does get_user/put_user actually return an error?
> 
> All the code I know just does:
> 
> 	if (get_user()))
> 		return -EFAULT;
> 
> and co.

According to the comment above it, it either returns zero on success, or -EFAULT
on error. So, both approaches are correct, either mine, or the one you
mentioned. It just seems more logical to me, to return whatever error code
returned by the function (well, macro), instead of hardcoding -EFAULT.

> 
> > +
> > +	block = usr_blk;
> > +	error = bmap(inode, &block);
> > +	if (error)
> > +		return error;
> > +	usr_blk = block;
> 
> Nitpick: maybe i'd name ur_block block and block sector, which seems
> to flow a little better.

Sure, it's ok for me, I'll change that on a V3
> 

-- 
Carlos



[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