public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: John Crispin <john@phrozen.org>
To: Luka Perkov <luka@openwrt.org>
Cc: Richard Weinberger <richard.weinberger@gmail.com>,
	John Crispin <blogic@openwrt.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH] UBI: add a ubi forced detach ioctl
Date: Mon, 12 May 2014 11:21:22 +0200	[thread overview]
Message-ID: <53709292.6070600@phrozen.org> (raw)
In-Reply-To: <CAFLxGvy+5udxOnRmEeKbHGr=z3a0H+vK07r+PbQdHiUkcJivQA@mail.gmail.com>

Hi Luka,

This is a ugly temporary patch that we carry around in openwrt until we
have a real fix. why are you trying to upstream this ?

Additionally the patch was written by Daniel and not me so the SoB is
wrong.

	John

On 12/05/2014 09:14, Richard Weinberger wrote:
> On Mon, May 12, 2014 at 1:17 AM, Luka Perkov <luka@openwrt.org> 
> wrote:
>> From: John Crispin <blogic@openwrt.org>
>> 
>> Signed-off-by: John Crispin <blogic@openwrt.org> Tested-by: Luka 
>> Perkov <luka@openwrt.org> CC: Artem Bityutskiy 
>> <dedekind1@gmail.com>
> 
> The changelog fails to describe why you need this new ioctl() and 
> what problem this patch is solving.
> 
>> --- drivers/mtd/ubi/cdev.c      | 7 +++++-- 
>> include/uapi/mtd/ubi-user.h | 1 + 2 files changed, 6 
>> insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c 
>> index f54562a..dce1171 100644 --- a/drivers/mtd/ubi/cdev.c +++ 
>> b/drivers/mtd/ubi/cdev.c @@ -970,7 +970,7 @@ static long 
>> ubi_cdev_ioctl(struct file *file, unsigned int cmd, static long 
>> ctrl_cdev_ioctl(struct file *file, unsigned int cmd, unsigned 
>> long arg) { -       int err = 0; +       int err = 0, force = 0;
>>  void __user *argp = (void __user *)arg;
>> 
>> if (!capable(CAP_SYS_RESOURCE)) @@ -1020,6 +1020,9 @@ static
>> long ctrl_cdev_ioctl(struct file *file, unsigned int cmd, }
>> 
>> /* Detach an MTD device command */ +       case UBI_IOCFDET: + 
>> force = 1; +               /* fallthrough */ case UBI_IOCDET: { 
>> int ubi_num; @@ -1032,7 +1035,7 @@ static long 
>> ctrl_cdev_ioctl(struct file *file, unsigned int cmd, }
>> 
>> mutex_lock(&ubi_devices_mutex); -               err = 
>> ubi_detach_mtd_dev(ubi_num, 0); +               err = 
>> ubi_detach_mtd_dev(ubi_num, force); 
>> mutex_unlock(&ubi_devices_mutex); break; } diff --git 
>> a/include/uapi/mtd/ubi-user.h b/include/uapi/mtd/ubi-user.h
>> index 1927b0d..7600e18 100644 --- a/include/uapi/mtd/ubi-user.h
>> +++ b/include/uapi/mtd/ubi-user.h @@ -178,6 +178,7 @@ #define 
>> UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req)
>> /* Detach an MTD device */ #define UBI_IOCDET 
>> _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32) +#define UBI_IOCFDET 
>> _IOW(UBI_CTRL_IOC_MAGIC, 66, __s32)
>> 
>> /* ioctl commands of UBI volume character devices */
>> 
>> -- 1.9.2
>> 
>> ______________________________________________________ Linux MTD 
>> discussion mailing list 
>> http://lists.infradead.org/mailman/listinfo/linux-mtd/
> 
> 
> 

  reply	other threads:[~2014-05-12  9:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11 23:17 [PATCH] UBI: add a ubi forced detach ioctl Luka Perkov
2014-05-12  7:14 ` Richard Weinberger
2014-05-12  9:21   ` John Crispin [this message]
2014-05-12 10:44     ` Luka Perkov
2014-05-12 13:47       ` Richard Weinberger
2014-05-12 14:30         ` Luka Perkov
2014-05-13  9:03       ` Artem Bityutskiy
2014-05-13  9:09         ` John Crispin

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=53709292.6070600@phrozen.org \
    --to=john@phrozen.org \
    --cc=blogic@openwrt.org \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=luka@openwrt.org \
    --cc=richard.weinberger@gmail.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