[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4506011F.9080708@ce.jp.nec.com>
Date: Mon, 11 Sep 2006 20:36:47 -0400
From: "Jun'ichi Nomura" <j-nomura@...jp.nec.com>
To: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...l.org>
CC: rdunlap@...otime.net, Alasdair Kergon <agk@...hat.com>
Subject: [-mm patch] Correct add_bd_holder() return value
Hi,
In blockdevc-check-errors.patch, add_bd_holder() is modified to
return error values when some of its operation failed.
Among them, it returns -EEXIST when a given bd_holder object already
exists in the list.
However, in this case, the function completed its work successfully
and need no action by its caller other than freeing unused bd_holder
object.
So I think it's better to return success after freeing by itself.
Otherwise, bd_claim-ing with same claim pointer will fail.
Typically, lvresize will fails with following message:
device-mapper: reload ioctl failed: Invalid argument
and you'll see messages like below in kernel log:
device-mapper: table: 254:13: linear: dm-linear: Device lookup failed
device-mapper: ioctl: error adding target to table
Similarly, it should not add bd_holder to the list if either one
of symlinking fails. I don't have a test case for this to happen
but it should cause dereference of freed pointer.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
View attachment "correct-add_bd_holder-return-value.patch" of type "text/x-patch" (1981 bytes)
Powered by blists - more mailing lists