lkml.org 
[lkml]   [2020]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/7] isofs: stop using ioctl_by_bdev
On Thu 23-04-20 09:12:23, Christoph Hellwig wrote:
> Instead just call the CD-ROM layer functionality directly, and turn the
> hot mess in isofs_get_last_session into remotely readable code.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

One comment below...

> ---
> fs/isofs/inode.c | 54 +++++++++++++++++++++++-------------------------
> 1 file changed, 26 insertions(+), 28 deletions(-)
>
> diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
> index 62c0462dc89f..fc48923a9b6c 100644
> --- a/fs/isofs/inode.c
> +++ b/fs/isofs/inode.c
> @@ -544,43 +544,41 @@ static int isofs_show_options(struct seq_file *m, struct dentry *root)
>
> static unsigned int isofs_get_last_session(struct super_block *sb, s32 session)
> {
> - struct cdrom_multisession ms_info;
> - unsigned int vol_desc_start;
> - struct block_device *bdev = sb->s_bdev;
> - int i;
> + struct cdrom_device_info *cdi = disk_to_cdi(sb->s_bdev->bd_disk);
> + unsigned int vol_desc_start = 0;
>
> - vol_desc_start=0;
> - ms_info.addr_format=CDROM_LBA;
> if (session > 0) {
> - struct cdrom_tocentry Te;
> - Te.cdte_track=session;
> - Te.cdte_format=CDROM_LBA;
> - i = ioctl_by_bdev(bdev, CDROMREADTOCENTRY, (unsigned long) &Te);
> - if (!i) {
> + struct cdrom_tocentry te;
> +
> + if (!cdi)
> + return -EINVAL;

There's no error handling in the caller and this function actually returns
unsigned int... So I believe you need to return 0 here to maintain previous
behavior (however suspicious it may be)?

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2020-04-23 13:04    [W:0.079 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site