* [Patch] Revert block_dev read-only check
@ 2011-02-16 22:19 Chuck Ebbert
2011-02-16 22:29 ` Linus Torvalds
0 siblings, 1 reply; 2+ messages in thread
From: Chuck Ebbert @ 2011-02-16 22:19 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Tejun Heo, linux-kernel, Milan Broz
This reverts commit 75f1dc0d076d1c1168f2115f1941ea627d38bd5a. The revert
could not be done automatically because changes after that commit
altered the code too much.
Signed-off-by: Chuck Ebbert <cebbert@redhat.com>
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1215,12 +1215,6 @@ int blkdev_get(struct block_device *bdev
res = __blkdev_get(bdev, mode, 0);
- /* __blkdev_get() may alter read only status, check it afterwards */
- if (!res && (mode & FMODE_WRITE) && bdev_read_only(bdev)) {
- __blkdev_put(bdev, mode, 0);
- res = -EACCES;
- }
-
if (whole) {
/* finish claiming */
mutex_lock(&bdev->bd_mutex);
@@ -1298,6 +1292,11 @@ struct block_device *blkdev_get_by_path(
if (err)
return ERR_PTR(err);
+ if ((mode & FMODE_WRITE) && bdev_read_only(bdev)) {
+ blkdev_put(bdev, mode);
+ return ERR_PTR(-EACCES);
+ }
+
return bdev;
}
EXPORT_SYMBOL(blkdev_get_by_path);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch] Revert block_dev read-only check
2011-02-16 22:19 [Patch] Revert block_dev read-only check Chuck Ebbert
@ 2011-02-16 22:29 ` Linus Torvalds
0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2011-02-16 22:29 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: Tejun Heo, linux-kernel, Milan Broz
On Wed, Feb 16, 2011 at 2:19 PM, Chuck Ebbert <cebbert@redhat.com> wrote:
> This reverts commit 75f1dc0d076d1c1168f2115f1941ea627d38bd5a. The revert
> could not be done automatically because changes after that commit
> altered the code too much.
I really want to hear about _why_ something is reverted too. I'm not
taking patches without explanations. And explaining that it's
non-automatic (and why _that_ is), is not explaining why it needed to
be reverted in the first place.
Please. Think of the poor people who wonder why..
Linus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-16 22:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 22:19 [Patch] Revert block_dev read-only check Chuck Ebbert
2011-02-16 22:29 ` Linus Torvalds
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.