From ae1eeecb52aa6347b16511d76c3ccba0bfb4157e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 10 Feb 2009 10:28:47 -0800 Subject: [PATCH] more .28 patches --- ...t-allow-two-clients-at-the-same-time.patch | 57 +++++++++++++++++++ .../sata_via-add-vt8261-support.patch | 28 +++++++++ queue-2.6.28/series | 1 + 3 files changed, 86 insertions(+) create mode 100644 queue-2.6.28/nbd-do-not-allow-two-clients-at-the-same-time.patch create mode 100644 queue-2.6.28/sata_via-add-vt8261-support.patch diff --git a/queue-2.6.28/nbd-do-not-allow-two-clients-at-the-same-time.patch b/queue-2.6.28/nbd-do-not-allow-two-clients-at-the-same-time.patch new file mode 100644 index 00000000000..508762c2923 --- /dev/null +++ b/queue-2.6.28/nbd-do-not-allow-two-clients-at-the-same-time.patch @@ -0,0 +1,57 @@ +From c91192d66d6cea7878b8542c9d9f1873971aba92 Mon Sep 17 00:00:00 2001 +From: Pavel Machek +Date: Thu, 15 Jan 2009 13:51:03 -0800 +Subject: nbd: do not allow two clients at the same time + +From: Pavel Machek + +commit c91192d66d6cea7878b8542c9d9f1873971aba92 upstream. + +Two nbd-clients at same time are bad idea, and cause WARN_ON from nbd in +2.6.28-rc7 from sysfs_add_one. This simply prevents that from happening. + +To reproduce: + + cat /dev/zero | head -c 10000000 > /tmp/delme.fstest.fs + nbd-server 9100 -l /anyone.can.connect > /tmp/delme.fstest.fs & + sleep 1 + nbd-client localhost 9100 /dev/nd0 & + nbd-client localhost 9100 /dev/nd0 & + +Signed-off-by: Pavel Machek +Acked-by: Paul Clements +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/nbd.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/block/nbd.c ++++ b/drivers/block/nbd.c +@@ -406,6 +406,7 @@ static int nbd_do_it(struct nbd_device * + ret = sysfs_create_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); + if (ret) { + printk(KERN_ERR "nbd: sysfs_create_file failed!"); ++ lo->pid = 0; + return ret; + } + +@@ -413,6 +414,7 @@ static int nbd_do_it(struct nbd_device * + nbd_end_request(req); + + sysfs_remove_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); ++ lo->pid = 0; + return 0; + } + +@@ -648,6 +650,8 @@ static int nbd_ioctl(struct block_device + set_capacity(lo->disk, lo->bytesize >> 9); + return 0; + case NBD_DO_IT: ++ if (lo->pid) ++ return -EBUSY; + if (!lo->file) + return -EINVAL; + thread = kthread_create(nbd_thread, lo, lo->disk->disk_name); diff --git a/queue-2.6.28/sata_via-add-vt8261-support.patch b/queue-2.6.28/sata_via-add-vt8261-support.patch new file mode 100644 index 00000000000..40fdf1fdc53 --- /dev/null +++ b/queue-2.6.28/sata_via-add-vt8261-support.patch @@ -0,0 +1,28 @@ +From 6813952021a7820a505002de260bda36978671f7 Mon Sep 17 00:00:00 2001 +From: JosephChan@via.com.tw +Date: Fri, 16 Jan 2009 19:44:55 +0800 +Subject: sata_via: Add VT8261 support + +From: JosephChan@via.com.tw + +commit 6813952021a7820a505002de260bda36978671f7 upstream. + +Signed-off-by: Joseph Chan +Signed-off-by: Jeff Garzik +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/sata_via.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/ata/sata_via.c ++++ b/drivers/ata/sata_via.c +@@ -92,6 +92,8 @@ static const struct pci_device_id svia_p + { PCI_VDEVICE(VIA, 0x5372), vt6420 }, + { PCI_VDEVICE(VIA, 0x7372), vt6420 }, + { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */ ++ { PCI_VDEVICE(VIA, 0x9000), vt8251 }, ++ { PCI_VDEVICE(VIA, 0x9040), vt8251 }, + + { } /* terminate list */ + }; diff --git a/queue-2.6.28/series b/queue-2.6.28/series index 1df2810ec54..539558981b3 100644 --- a/queue-2.6.28/series +++ b/queue-2.6.28/series @@ -49,3 +49,4 @@ usb-new-id-for-ti_usb_3410_5052-driver.patch usb-two-more-usb-ids-for-ti_usb_3410_5052.patch usb-usb-storage-add-pentax-to-the-bad-vendor-list.patch sata_via-add-vt8261-support.patch +nbd-do-not-allow-two-clients-at-the-same-time.patch -- 2.47.3