[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C5BEA4E.4070107@kernel.dk>
Date: Fri, 06 Aug 2010 12:56:14 +0200
From: Jens Axboe <axboe@...nel.dk>
To: Dmitry Monakhov <dmonakhov@...nvz.org>
CC: linux-kernel@...r.kernel.org
Subject: Re: Resend: [PATCH] blkdev: fix blkdev_issue_zeroout return value
On 2010-08-06 12:42, Dmitry Monakhov wrote:
> Hi Jens,
> Seems that my first mail was missed somewhere.
> I've found couple of trivial issues in blkdev_issue_zeroout()
> implementation. Unfortunately I've miss during initial testing phase
> because always called it with BARRIER|WAIT flags.
BTW, this:
@@ -218,15 +222,18 @@ submit:
/* One of bios in the batch was completed with error.*/
ret = -EIO;
- if (ret)
+ if (ret && ret != -ENOMEM)
goto out;
if (test_bit(BIO_EOPNOTSUPP, &bb.flags)) {
ret = -EOPNOTSUPP;
goto out;
}
- if (nr_sects != 0)
+ if (nr_sects != 0) {
+ if (ret == -ENOMEM)
+ io_schedule();
goto submit;
+ }
out:
return ret;
}
is broken. Either the caller sets __GFP_WAIT and then bio_alloc() will
not fail, or GFP_ATOMIC is used knowing that the call can fail and
return ENOMEM. Don't code in retry logic like this.
--
Jens Axboe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists