public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Andrew Morton <akpm@osdl.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@osdl.org>
Subject: [PATCH] error value for opening block devices
Date: Sat, 20 Mar 2004 02:13:47 -0800	[thread overview]
Message-ID: <405C195B.10004@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

Opening a non-existing block device currently yields an ENXIO error.
Doing the same for char devices produces the correct error ENODEV.

The attached patch fixes the symptoms.  Somebody with more knowledge
will have to decide whether there are any negative side effects.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

[-- Attachment #2: d-blk-enodev --]
[-- Type: text/plain, Size: 523 bytes --]

--- fs/block_dev.c-save	2004-03-12 11:44:14.000000000 -0800
+++ fs/block_dev.c	2004-03-20 01:53:19.000000000 -0800
@@ -550,7 +550,7 @@ static int do_open(struct block_device *
 {
 	struct module *owner = NULL;
 	struct gendisk *disk;
-	int ret = -ENXIO;
+	int ret = -ENODEV;
 	int part;
 
 	file->f_mapping = bdev->bd_inode->i_mapping;
@@ -563,6 +563,7 @@ static int do_open(struct block_device *
 	}
 	owner = disk->fops->owner;
 
+	ret = -ENXIO;
 	down(&bdev->bd_sem);
 	if (!bdev->bd_openers) {
 		bdev->bd_disk = disk;

             reply	other threads:[~2004-03-20 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-20 10:13 Ulrich Drepper [this message]
2004-03-22  3:57 ` [PATCH] error value for opening block devices Randy.Dunlap
2004-03-22  4:13   ` Andrew Morton

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=405C195B.10004@redhat.com \
    --to=drepper@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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