Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-27 Thread Hannes Reinecke
On 07/17/2012 11:59 PM, James Bottomley wrote: > On Tue, 2012-07-17 at 12:36 -0400, Christoph Hellwig wrote: >> On Tue, Jul 17, 2012 at 10:11:57AM +0100, James Bottomley wrote: >>> There's no such thing in the market today as a removable disk that's >>> resizeable. Removable disks are for things

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-27 Thread Hannes Reinecke
On 07/17/2012 11:59 PM, James Bottomley wrote: On Tue, 2012-07-17 at 12:36 -0400, Christoph Hellwig wrote: On Tue, Jul 17, 2012 at 10:11:57AM +0100, James Bottomley wrote: There's no such thing in the market today as a removable disk that's resizeable. Removable disks are for things like

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-25 Thread Hannes Reinecke
On 07/17/2012 11:11 AM, James Bottomley wrote: > On Tue, 2012-07-17 at 10:54 +0200, Paolo Bonzini wrote: >> Il 17/07/2012 10:40, James Bottomley ha scritto: > > It's not specific to virtio-scsi, in fact I expect that virtio-scsi will > be almost always used with non-removable disks.

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-25 Thread Hannes Reinecke
On 07/17/2012 11:11 AM, James Bottomley wrote: On Tue, 2012-07-17 at 10:54 +0200, Paolo Bonzini wrote: Il 17/07/2012 10:40, James Bottomley ha scritto: It's not specific to virtio-scsi, in fact I expect that virtio-scsi will be almost always used with non-removable disks. However, QEMU's

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 12:36 -0400, Christoph Hellwig wrote: > On Tue, Jul 17, 2012 at 10:11:57AM +0100, James Bottomley wrote: > > There's no such thing in the market today as a removable disk that's > > resizeable. Removable disks are for things like backup cartridges and > > ageing jazz drives.

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 20:49, Mike Christie ha scritto: > > Not sure if we are talking about the same thing. > > > > So can virtio-scsi send a UA with asc/ascq that indicates the lun > > changed size? Other drivers do this. I updated Hannes's patches the > > other day to support UAs like those in

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Mike Christie
On 07/17/2012 12:45 PM, Mike Christie wrote: > On 07/17/2012 10:47 AM, Paolo Bonzini wrote: >> Il 17/07/2012 18:36, Christoph Hellwig ha scritto: > There's no such thing in the market today as a removable disk that's > resizeable. Removable disks are for things like backup cartridges and

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Mike Christie
On 07/17/2012 10:47 AM, Paolo Bonzini wrote: > Il 17/07/2012 18:36, Christoph Hellwig ha scritto: There's no such thing in the market today as a removable disk that's resizeable. Removable disks are for things like backup cartridges and ageing jazz drives. Worse: most removeable

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Christoph Hellwig
On Tue, Jul 17, 2012 at 06:47:15PM +0200, Paolo Bonzini wrote: > Il 17/07/2012 18:36, Christoph Hellwig ha scritto: > >> > There's no such thing in the market today as a removable disk that's > >> > resizeable. Removable disks are for things like backup cartridges and > >> > ageing jazz drives.

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 18:36, Christoph Hellwig ha scritto: >> > There's no such thing in the market today as a removable disk that's >> > resizeable. Removable disks are for things like backup cartridges and >> > ageing jazz drives. Worse: most removeable devices today are USB card >> > readers whose

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Christoph Hellwig
On Tue, Jul 17, 2012 at 10:11:57AM +0100, James Bottomley wrote: > There's no such thing in the market today as a removable disk that's > resizeable. Removable disks are for things like backup cartridges and > ageing jazz drives. Worse: most removeable devices today are USB card > readers whose

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 14:31 +0200, Paolo Bonzini wrote: > Il 17/07/2012 14:21, James Bottomley ha scritto: > >> Yes, I realize failing only on specific sense codes as I did it in the > >> patch is not going to work. However, the other way round is not > >> problematic (explicitly allow some sense

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 14:21, James Bottomley ha scritto: >> Yes, I realize failing only on specific sense codes as I did it in the >> patch is not going to work. However, the other way round is not >> problematic (explicitly allow some sense codes, fail on all others). > > Heh, I once thought that, but

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 11:28 +0200, Paolo Bonzini wrote: > Il 17/07/2012 11:11, James Bottomley ha scritto: > > We don't do stuff just because the standards allows it; just the > > opposite: we try to use the smallest implementations from the standards > > we can get away with just because the more

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 11:11, James Bottomley ha scritto: > We don't do stuff just because the standards allows it; just the > opposite: we try to use the smallest implementations from the standards > we can get away with just because the more things we do, the more > exceptions and broken devices we come

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 10:54 +0200, Paolo Bonzini wrote: > Il 17/07/2012 10:40, James Bottomley ha scritto: > >> > > >> > It's not specific to virtio-scsi, in fact I expect that virtio-scsi will > >> > be almost always used with non-removable disks. > >> > > >> > However, QEMU's SCSI target is

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 10:40, James Bottomley ha scritto: >> > >> > It's not specific to virtio-scsi, in fact I expect that virtio-scsi will >> > be almost always used with non-removable disks. >> > >> > However, QEMU's SCSI target is not used just for virtio-scsi (for >> > example it can be used for USB

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 10:34 +0200, Paolo Bonzini wrote: > Il 17/07/2012 09:45, James Bottomley ha scritto: > > On Mon, 2012-07-16 at 19:20 +0200, Paolo Bonzini wrote: > >> Il 16/07/2012 18:18, James Bottomley ha scritto: > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 09:45, James Bottomley ha scritto: > On Mon, 2012-07-16 at 19:20 +0200, Paolo Bonzini wrote: >> Il 16/07/2012 18:18, James Bottomley ha scritto: > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index b583277..6d8ca08 100644 > ---

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Mon, 2012-07-16 at 19:20 +0200, Paolo Bonzini wrote: > Il 16/07/2012 18:18, James Bottomley ha scritto: > >> > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > >> > index b583277..6d8ca08 100644 > >> > --- a/drivers/scsi/scsi_lib.c > >> > +++ b/drivers/scsi/scsi_lib.c > >> > @@

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Mon, 2012-07-16 at 19:20 +0200, Paolo Bonzini wrote: Il 16/07/2012 18:18, James Bottomley ha scritto: diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index b583277..6d8ca08 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -843,8 +843,11 @@

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 09:45, James Bottomley ha scritto: On Mon, 2012-07-16 at 19:20 +0200, Paolo Bonzini wrote: Il 16/07/2012 18:18, James Bottomley ha scritto: diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index b583277..6d8ca08 100644 --- a/drivers/scsi/scsi_lib.c +++

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 10:34 +0200, Paolo Bonzini wrote: Il 17/07/2012 09:45, James Bottomley ha scritto: On Mon, 2012-07-16 at 19:20 +0200, Paolo Bonzini wrote: Il 16/07/2012 18:18, James Bottomley ha scritto: diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 10:40, James Bottomley ha scritto: It's not specific to virtio-scsi, in fact I expect that virtio-scsi will be almost always used with non-removable disks. However, QEMU's SCSI target is not used just for virtio-scsi (for example it can be used for USB storage), and it

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 10:54 +0200, Paolo Bonzini wrote: Il 17/07/2012 10:40, James Bottomley ha scritto: It's not specific to virtio-scsi, in fact I expect that virtio-scsi will be almost always used with non-removable disks. However, QEMU's SCSI target is not used just for

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 11:11, James Bottomley ha scritto: We don't do stuff just because the standards allows it; just the opposite: we try to use the smallest implementations from the standards we can get away with just because the more things we do, the more exceptions and broken devices we come

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 11:28 +0200, Paolo Bonzini wrote: Il 17/07/2012 11:11, James Bottomley ha scritto: We don't do stuff just because the standards allows it; just the opposite: we try to use the smallest implementations from the standards we can get away with just because the more things

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 14:21, James Bottomley ha scritto: Yes, I realize failing only on specific sense codes as I did it in the patch is not going to work. However, the other way round is not problematic (explicitly allow some sense codes, fail on all others). Heh, I once thought that, but there's

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 14:31 +0200, Paolo Bonzini wrote: Il 17/07/2012 14:21, James Bottomley ha scritto: Yes, I realize failing only on specific sense codes as I did it in the patch is not going to work. However, the other way round is not problematic (explicitly allow some sense codes,

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Christoph Hellwig
On Tue, Jul 17, 2012 at 10:11:57AM +0100, James Bottomley wrote: There's no such thing in the market today as a removable disk that's resizeable. Removable disks are for things like backup cartridges and ageing jazz drives. Worse: most removeable devices today are USB card readers whose

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 18:36, Christoph Hellwig ha scritto: There's no such thing in the market today as a removable disk that's resizeable. Removable disks are for things like backup cartridges and ageing jazz drives. Worse: most removeable devices today are USB card readers whose standards

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Christoph Hellwig
On Tue, Jul 17, 2012 at 06:47:15PM +0200, Paolo Bonzini wrote: Il 17/07/2012 18:36, Christoph Hellwig ha scritto: There's no such thing in the market today as a removable disk that's resizeable. Removable disks are for things like backup cartridges and ageing jazz drives. Worse: most

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Mike Christie
On 07/17/2012 10:47 AM, Paolo Bonzini wrote: Il 17/07/2012 18:36, Christoph Hellwig ha scritto: There's no such thing in the market today as a removable disk that's resizeable. Removable disks are for things like backup cartridges and ageing jazz drives. Worse: most removeable devices today

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Mike Christie
On 07/17/2012 12:45 PM, Mike Christie wrote: On 07/17/2012 10:47 AM, Paolo Bonzini wrote: Il 17/07/2012 18:36, Christoph Hellwig ha scritto: There's no such thing in the market today as a removable disk that's resizeable. Removable disks are for things like backup cartridges and ageing jazz

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread Paolo Bonzini
Il 17/07/2012 20:49, Mike Christie ha scritto: Not sure if we are talking about the same thing. So can virtio-scsi send a UA with asc/ascq that indicates the lun changed size? Other drivers do this. I updated Hannes's patches the other day to support UAs like those in userspace. I

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-17 Thread James Bottomley
On Tue, 2012-07-17 at 12:36 -0400, Christoph Hellwig wrote: On Tue, Jul 17, 2012 at 10:11:57AM +0100, James Bottomley wrote: There's no such thing in the market today as a removable disk that's resizeable. Removable disks are for things like backup cartridges and ageing jazz drives.

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread Paolo Bonzini
Il 16/07/2012 18:18, James Bottomley ha scritto: >> > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >> > index b583277..6d8ca08 100644 >> > --- a/drivers/scsi/scsi_lib.c >> > +++ b/drivers/scsi/scsi_lib.c >> > @@ -843,8 +843,11 @@ void scsi_io_completion(struct scsi_cmnd *cmd, >>

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread James Bottomley
On Mon, 2012-07-16 at 18:06 +0200, Paolo Bonzini wrote: > Right now, I/O will fail as soon as a unit attention condition is > detected on a unit with removable media. However, this is not > always necessary. There are some cases (such as "Capacity data > has changed") where no particular action

[PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread Paolo Bonzini
Right now, I/O will fail as soon as a unit attention condition is detected on a unit with removable media. However, this is not always necessary. There are some cases (such as "Capacity data has changed") where no particular action is needed. On the other hand, all problematic cases have to

[PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread Paolo Bonzini
Right now, I/O will fail as soon as a unit attention condition is detected on a unit with removable media. However, this is not always necessary. There are some cases (such as Capacity data has changed) where no particular action is needed. On the other hand, all problematic cases have to

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread James Bottomley
On Mon, 2012-07-16 at 18:06 +0200, Paolo Bonzini wrote: Right now, I/O will fail as soon as a unit attention condition is detected on a unit with removable media. However, this is not always necessary. There are some cases (such as Capacity data has changed) where no particular action is

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread Paolo Bonzini
Il 16/07/2012 18:18, James Bottomley ha scritto: diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index b583277..6d8ca08 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -843,8 +843,11 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int