Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1695704ybz; Thu, 23 Apr 2020 04:05:44 -0700 (PDT) X-Google-Smtp-Source: APiQypKUuRBPMH6q5s4PYPcZge2EiHkLEtsjYbOE5/SLX2Zz7ootdDsBsr8geYMfNbTS6Mgwgtgr X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr2294515ejb.6.1587639944264; Thu, 23 Apr 2020 04:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587639944; cv=none; d=google.com; s=arc-20160816; b=GT8CJ4P9MbIv3lvLJw2xRsnpG3AtnKVRbAt50+eAqKzxgtktPSLAJuwyw/3uaJxq2G fCE2MKCe//WRatIzb1PvorM1OhqdzeZovmiQv25A8MAwsj478haPIOCAbunjUasRZDrw l1z7fDwFeCQ+4uF+42RVlyrUJFM7odyJiwzWsrVBodYv4znYaZZQwxgduCoG438c0Rn3 f9blO+r2sgF73lMn7y97+m5u9LLVXWzepNXYeMdNINFkQXemqxY0TptslDZtvZLauW3y ZsLrDyd++j8IWX+AzIC5uL/iYbJeGlkubvruWyH9rhMJmzWnsxwtkcHcFZQi5neotGMq LUpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XCsl5knm679kZqkqnR5T6oskd6bwrpytR1JBa8Bka9U=; b=wYcoMnVNb86nqJBluGo/tllhR64bLFH/8NVWSh/ue9YMcUMLgTFuc8R7Ehjbz9B4+4 TpNxAEMaaDjrVPeEV9fSGtx/lbraGOLcdDUP6BTcuPS+nO2q5HFpGPSni4tQccWso/dY nnX8N6r/Ss1WACJ7XaoW8J8S1OROqVDbpBc6XashCJ0ggDpGHoaFU7yo6v6ui8F5OKbl D6XqYc3PWvACyTFDLw3hc6wcHUKXeOc9VhJ4lovIE9QttkOfBgLxH0YJrfW1j6Tu0rxk GNAkxqkyNQbsucewFSuFZP8IakNUs9xeK80dyHG4xi06YxznpeAODjQvDBqsciCOvWsh UDXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b26si896752edw.447.2020.04.23.04.05.13; Thu, 23 Apr 2020 04:05:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727951AbgDWLDu (ORCPT + 99 others); Thu, 23 Apr 2020 07:03:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:45482 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbgDWLDu (ORCPT ); Thu, 23 Apr 2020 07:03:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C34D8B0AE; Thu, 23 Apr 2020 11:03:47 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id BD00A1E1293; Thu, 23 Apr 2020 13:03:47 +0200 (CEST) Date: Thu, 23 Apr 2020 13:03:47 +0200 From: Jan Kara To: Christoph Hellwig Cc: Jens Axboe , Tim Waugh , Borislav Petkov , Jan Kara , linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] isofs: stop using ioctl_by_bdev Message-ID: <20200423110347.GE3737@quack2.suse.cz> References: <20200423071224.500849-1-hch@lst.de> <20200423071224.500849-7-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200423071224.500849-7-hch@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 SUSE Labs, CR