From: Christoph Hellwig <hch@lst.de>
To: Martijn Coenen <maco@android.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
Ming Lei <ming.lei@redhat.com>,
Narayan Kamath <narayan@google.com>,
Zimuzo Ezeozue <zezeozue@google.com>,
kernel-team@android.com,
linux-block <linux-block@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Martijn Coenen <maco@google.com>,
Bart Van Assche <bvanassche@acm.org>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Subject: Re: [PATCH 4/4] loop: Add LOOP_SET_FD_AND_STATUS ioctl.
Date: Wed, 22 Apr 2020 10:07:52 +0200 [thread overview]
Message-ID: <20200422080752.GA24916@lst.de> (raw)
In-Reply-To: <CAB0TPYHCHytLouWSpwKvi3qpZCzAYhuEot9y+ssnE8vDGgtQpg@mail.gmail.com>
On Wed, Apr 22, 2020 at 10:06:17AM +0200, Martijn Coenen wrote:
> > line at the top of lo_compat_ioctl, and switches the LOOP_SET_STATUS
> > and LOOP_GET_STATUS case to it?
>
> Did you mean in regular lo_ioctl()?
Yes, sorry.
> eg something like this:
>
> @@ -1671,6 +1671,7 @@ static int lo_ioctl(struct block_device *bdev,
> fmode_t mode,
> unsigned int cmd, unsigned long arg)
> {
> struct loop_device *lo = bdev->bd_disk->private_data;
> + void __user *argp = (void __user *) arg;
> int err;
>
> switch (cmd) {
> @@ -1694,21 +1695,19 @@ static int lo_ioctl(struct block_device *bdev,
> fmode_t mode,
> case LOOP_SET_STATUS:
> err = -EPERM;
> if ((mode & FMODE_WRITE) || capable(CAP_SYS_ADMIN)) {
> - err = loop_set_status_old(lo,
> - (struct loop_info __user *)arg);
> + err = loop_set_status_old(lo, argp);
> }
> break;
> case LOOP_GET_STATUS:
> - return loop_get_status_old(lo, (struct loop_info __user *) arg);
> + return loop_get_status_old(lo, argp);
> case LOOP_SET_STATUS64:
> err = -EPERM;
> if ((mode & FMODE_WRITE) || capable(CAP_SYS_ADMIN)) {
> - err = loop_set_status64(lo,
> - (struct loop_info64 __user *) arg);
> + err = loop_set_status64(lo, argp);
> }
> break;
> case LOOP_GET_STATUS64:
> - return loop_get_status64(lo, (struct loop_info64 __user *) arg);
> + return loop_get_status64(lo, argp);
Exactly!
next prev parent reply other threads:[~2020-04-22 8:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 8:04 [PATCH 0/4] Add a new LOOP_SET_FD_AND_STATUS ioctl Martijn Coenen
2020-04-20 8:04 ` [PATCH 1/4] loop: Refactor size calculation Martijn Coenen
2020-04-20 13:22 ` Bart Van Assche
2020-04-21 11:48 ` Martijn Coenen
2020-04-21 15:26 ` Bart Van Assche
2020-04-20 8:04 ` [PATCH 2/4] loop: Factor out configuring loop from status Martijn Coenen
2020-04-20 13:34 ` Bart Van Assche
2020-04-20 13:49 ` Bart Van Assche
2020-04-21 11:46 ` Martijn Coenen
2020-04-20 8:04 ` [PATCH 3/4] loop: Move loop_set_from_status() and friends up Martijn Coenen
2020-04-20 13:43 ` Bart Van Assche
2020-04-20 8:04 ` [PATCH 4/4] loop: Add LOOP_SET_FD_AND_STATUS ioctl Martijn Coenen
2020-04-22 6:19 ` Christoph Hellwig
2020-04-22 8:06 ` Martijn Coenen
2020-04-22 8:07 ` Christoph Hellwig [this message]
2020-04-22 15:10 ` Bart Van Assche
2020-04-27 7:42 ` Martijn Coenen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200422080752.GA24916@lst.de \
--to=hch@lst.de \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=kernel-team@android.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=maco@google.com \
--cc=ming.lei@redhat.com \
--cc=narayan@google.com \
--cc=zezeozue@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).