linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: linux-mtd@lists.infradead.org,
	Andrew Morton <akpm@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Maciej Rutecki <maciej.rutecki@gmail.com>
Subject: Re: [PATCH 1/3] MTD: blktrans: Final version of hotplug support
Date: Mon, 20 Sep 2010 11:28:29 +0300	[thread overview]
Message-ID: <1284971309.2286.44.camel@localhost> (raw)
In-Reply-To: <1284851558-1154-2-git-send-email-maximlevitsky@gmail.com>

In one of your e-mails you said this patch is minimalistic. Here are
some suggestions.

On Sun, 2010-09-19 at 01:12 +0200, Maxim Levitsky wrote:
> Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
> ---
>  drivers/mtd/mtd_blkdevs.c |   67 +++++++++++++++++++-------------------------
>  1 files changed, 29 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
> index 62e6870..d773a40 100644
> --- a/drivers/mtd/mtd_blkdevs.c
> +++ b/drivers/mtd/mtd_blkdevs.c
> @@ -47,7 +47,6 @@ void blktrans_dev_release(struct kref *kref)
>  		container_of(kref, struct mtd_blktrans_dev, ref);
>  
>  	dev->disk->private_data = NULL;
> -	blk_cleanup_queue(dev->rq);

Them can be a separate patch.
>  	put_disk(dev->disk);
>  	list_del(&dev->list);
>  	kfree(dev);
> @@ -133,6 +132,10 @@ static int mtd_blktrans_thread(void *arg)
>  
>  		if (!req && !(req = blk_fetch_request(rq))) {
>  			set_current_state(TASK_INTERRUPTIBLE);
> +
> +			if (kthread_should_stop())
> +				break;

This could be a separate patch.

> +
>  			spin_unlock_irq(rq->queue_lock);
>  			schedule();
>  			spin_lock_irq(rq->queue_lock);
> @@ -176,54 +179,51 @@ static void mtd_blktrans_request(struct request_queue *rq)
>  static int blktrans_open(struct block_device *bdev, fmode_t mode)
>  {
>  	struct mtd_blktrans_dev *dev = blktrans_dev_get(bdev->bd_disk);
> -	int ret;
> +	int ret = 0;
>  
>  	if (!dev)
> -		return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/
> +		return -EIO;

Hmm, why EIO? ENODEV is better. And this can be a separate patch, may
be?

> -	lock_kernel();
>  	mutex_lock(&dev->lock);
>  
> -	if (!dev->mtd) {
> -		ret = -ENXIO;
> +	if (dev->open++)
>  		goto unlock;
> -	}
>  
> -	ret = !dev->open++ && dev->tr->open ? dev->tr->open(dev) : 0;
> +	kref_get(&dev->ref);
> +
> +	if (dev->mtd) {
> +		ret = dev->tr->open ? dev->tr->open(dev) : 0;
> +		__get_mtd_device(dev->mtd);
> +	}
>  
> -	/* Take another reference on the device so it won't go away till
> -		last release */
> -	if (!ret)
> -		kref_get(&dev->ref);
>  unlock:
>  	mutex_unlock(&dev->lock);
>  	blktrans_dev_put(dev);
> -	unlock_kernel();

So you kill BKL in the same patch? No, make it separately, please.

Did not look further.

Please, make a nice set of independent minimalistic patches. This is
very important for patches which will go to 2.6.36 to be minimal and
just fix the problem. Then the rest of the patches can do more things
and they will go to 2.6.37.
 

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  parent reply	other threads:[~2010-09-20  8:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-18 23:12 [MTD] My updates Maxim Levitsky
2010-09-18 23:12 ` [PATCH 1/3] MTD: blktrans: Final version of hotplug support Maxim Levitsky
2010-09-19  2:03   ` [PATCH V2] " maximlevitsky
2010-09-19 18:28   ` [PATCH 1/3] " Artem Bityutskiy
2010-09-19 20:35     ` Maxim Levitsky
2010-09-20  1:08       ` Maxim Levitsky
2010-09-20  8:28   ` Artem Bityutskiy [this message]
2010-09-18 23:12 ` [PATCH 2/3] MTD: r852: remove useless pci powerup/down from suspend/resume routines Maxim Levitsky
2010-09-18 23:12 ` [PATCH 3/3] mtd: sm_ftl: cosmetic, use bool when possible Maxim Levitsky

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=1284971309.2286.44.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=maciej.rutecki@gmail.com \
    --cc=maximlevitsky@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;
as well as URLs for NNTP newsgroup(s).