All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: dm-devel@redhat.com
Subject: [PATCH] dm: Allow tables to have devices with zero size
Date: Mon, 8 Jan 2007 14:57:46 -0800	[thread overview]
Message-ID: <20070108225746.GA3966@us.ibm.com> (raw)

From: Mike Anderson <andmike@us.ibm.com>

Allow check_device_area to succeed if a device has an i_size of zero. This
addresses an issue seen on DASD devices setting up a multipath table for
paths in online and offline state.

Signed-off-by: Mike Anderson <andmike@us.ibm.com>
---

 drivers/md/dm-table.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6-patched/drivers/md/dm-table.c
===================================================================
--- linux-2.6-patched.orig/drivers/md/dm-table.c	2006-12-31 16:53:20.000000000 -0800
+++ linux-2.6-patched/drivers/md/dm-table.c	2007-01-08 08:15:33.000000000 -0800
@@ -432,7 +432,8 @@
 {
 	sector_t dev_size;
 	dev_size = dd->bdev->bd_inode->i_size >> SECTOR_SHIFT;
-	return ((start < dev_size) && (len <= (dev_size - start)));
+	return dev_size ?
+		((start < dev_size) && (len <= (dev_size - start))) : 1;
 }
 
 /*

                 reply	other threads:[~2007-01-08 22:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070108225746.GA3966@us.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=dm-devel@redhat.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 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.