- nbd-set-uninitialized-devices-to-size-0.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     NBD: set uninitialized devices to size 0
has been removed from the -mm tree.  Its filename was
     nbd-set-uninitialized-devices-to-size-0.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: NBD: set uninitialized devices to size 0
From: Paul Clements <paul.clements@xxxxxxxxxxxx>

This fixes errors with utilities (such as LVM's vgscan) that try to scan all
devices.  Previously this would generate read errors when uninitialized nbd
devices were scanned:

# vgscan
   Reading all physical volumes.  This may take a while...
   /dev/nbd0: read failed after 0 of 1024 at 0: Input/output error
   /dev/nbd0: read failed after 0 of 1024 at 509804544: Input/output error
   /dev/nbd0: read failed after 0 of 2048 at 0: Input/output error
   /dev/nbd1: read failed after 0 of 1024 at 509804544: Input/output error
   /dev/nbd1: read failed after 0 of 2048 at 0: Input/output error

 From now on, uninitialized nbd devices will have size zero, which
prevents these errors.

Signed-off-by: Paul Clements <paul.clements@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/block/nbd.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff -puN drivers/block/nbd.c~nbd-set-uninitialized-devices-to-size-0 drivers/block/nbd.c
--- a/drivers/block/nbd.c~nbd-set-uninitialized-devices-to-size-0
+++ a/drivers/block/nbd.c
@@ -578,6 +578,9 @@ static int nbd_ioctl(struct inode *inode
 		printk(KERN_WARNING "%s: queue cleared\n", lo->disk->disk_name);
 		if (file)
 			fput(file);
+		lo->bytesize = 0;
+		inode->i_bdev->bd_inode->i_size = 0;
+		set_capacity(lo->disk, 0);
 		return lo->harderror;
 	case NBD_CLEAR_QUE:
 		/*
@@ -655,14 +658,14 @@ static int __init nbd_init(void)
 		mutex_init(&nbd_dev[i].tx_lock);
 		init_waitqueue_head(&nbd_dev[i].active_wq);
 		nbd_dev[i].blksize = 1024;
-		nbd_dev[i].bytesize = 0x7ffffc00ULL << 10; /* 2TB */
+		nbd_dev[i].bytesize = 0;
 		disk->major = NBD_MAJOR;
 		disk->first_minor = i;
 		disk->fops = &nbd_fops;
 		disk->private_data = &nbd_dev[i];
 		disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
 		sprintf(disk->disk_name, "nbd%d", i);
-		set_capacity(disk, 0x7ffffc00ULL << 1); /* 2 TB */
+		set_capacity(disk, 0);
 		add_disk(disk);
 	}
 
_

Patches currently in -mm which might be from paul.clements@xxxxxxxxxxxx are

origin.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux