[PATCH v2 3/3] bfq: Add per-device weight

2019-08-05 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/bfq-cgroup.c | 95 ++--- block/bfq-iosched.h | 3 ++ 2 files changed, 87 insertions(+), 11 deletions(-) diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index 28e5a9241237..de4fd8b725aa 100644 --- a/block

[PATCH v2 0/3] Implement BFQ per-device weight interface

2019-08-05 Thread Fam Zheng
v2 runs -- sda.test1.out: READ: bw=915MiB/s sda.test2.out: READ: bw=184MiB/s sdb.test1.out: READ: bw=216MiB/s sdb.test2.out: READ: bw=1069MiB/s sdc.test1.out: READ: bw=621MiB/s sdc.test2.out: READ: bw=622MiB/s Fam Zheng (3): bfq: Fix the missing

Re: [External Email] Re: [PATCH 1/2] virtio-mmio: Process vrings more proactively

2019-07-21 Thread Fam Zheng
On 7/19/19 11:17 PM, Michael S. Tsirkin wrote: On Fri, Jul 19, 2019 at 09:31:34PM +0800, Fei Li wrote: From: Fam Zheng This allows the backend to _not_ trap mmio read of the status register after injecting IRQ in the data path, which can improve the performance significantly by avoiding

Re: [PATCH 4/9] nvme/pci: use the NVME_CTRL_SUSPENDED state

2019-03-19 Thread Fam Zheng
On Tue, 03/19 16:41, Maxim Levitsky wrote: > When enteriing low power state, the nvme Typo: "entering". > driver will now inform the core with the NVME_CTRL_SUSPENDED state > which will allow mdev driver to act on this information [snip] Fam

[PATCH] devpts: Use simple_dentry_operations

2019-02-26 Thread Fam Zheng
rue; done In a few minutes the system will have a very unbalanced dentry_hashtable. This patch fixes the above issue. Signed-off-by: Fam Zheng --- fs/devpts/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index c53814539070..ce43301f1219 100644 --- a

Re: [PATCH] virtio_scsi: always read VPD pages for multiqueue too

2017-07-05 Thread Fam Zheng
= virtscsi_device_reset, > + .slave_alloc = virtscsi_device_alloc, > > .can_queue = 1024, > .dma_boundary = UINT_MAX, > -- > 1.8.3.1 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [PATCH] virtio_scsi: always read VPD pages for multiqueue too

2017-07-05 Thread Fam Zheng
; > .can_queue = 1024, > .dma_boundary = UINT_MAX, > -- > 1.8.3.1 > Reviewed-by: Fam Zheng

[PATCH] sd: Explicit type cast to fix calculating rw_max

2017-04-06 Thread Fam Zheng
Some compilers don't like BLK_DEF_MAX_SECTORS being an enum (int) when expanding min_not_zero. Cast it to sector_t so it matches the type of the other operand, logical_to_sectors(). Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion

[PATCH] sd: Explicit type cast to fix calculating rw_max

2017-04-06 Thread Fam Zheng
Some compilers don't like BLK_DEF_MAX_SECTORS being an enum (int) when expanding min_not_zero. Cast it to sector_t so it matches the type of the other operand, logical_to_sectors(). Signed-off-by: Fam Zheng --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: linux-next: build warning after merge of the scsi tree

2017-04-06 Thread Fam Zheng
On Thu, 04/06 14:04, Stephen Rothwell wrote: > Hi James, > > After merging the scsi tree, today's linux-next build (arm > multi_v7_defconfig) produced this warning: > > In file included from include/linux/list.h:8:0, > from include/linux/module.h:9, > from

Re: linux-next: build warning after merge of the scsi tree

2017-04-06 Thread Fam Zheng
On Thu, 04/06 14:04, Stephen Rothwell wrote: > Hi James, > > After merging the scsi tree, today's linux-next build (arm > multi_v7_defconfig) produced this warning: > > In file included from include/linux/list.h:8:0, > from include/linux/module.h:9, > from

Re: [PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-30 Thread Fam Zheng
On Thu, 03/30 11:30, Martin K. Petersen wrote: > Fam Zheng <f...@redhat.com> writes: > > >>rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), > >> BLK_DEF_MAX_SECTORS); > > > > Yes, it is better. Is it okay to

Re: [PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-30 Thread Fam Zheng
On Thu, 03/30 11:30, Martin K. Petersen wrote: > Fam Zheng writes: > > >>rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), > >> BLK_DEF_MAX_SECTORS); > > > > Yes, it is better. Is it okay to make the change when you ap

Re: [PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-29 Thread Fam Zheng
On Wed, 03/29 22:37, Martin K. Petersen wrote: > Fam Zheng <f...@redhat.com> writes: > > Fam, > > > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c > > index fcfeddc..a5c7e67 100644 > > --- a/drivers/scsi/sd.c > > +++ b/drivers/scsi/sd.c > > @@

Re: [PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-29 Thread Fam Zheng
On Wed, 03/29 22:37, Martin K. Petersen wrote: > Fam Zheng writes: > > Fam, > > > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c > > index fcfeddc..a5c7e67 100644 > > --- a/drivers/scsi/sd.c > > +++ b/drivers/scsi/sd.c > > @@ -2957,6 +2957,7 @@ st

[PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-27 Thread Fam Zheng
If device reports a small max_xfer_blocks and a zero opt_xfer_blocks, we end up using BLK_DEF_MAX_SECTORS, which is wrong and r/w of that size may get error. Fixes: ca369d51b3e ("block/sd: Fix device-imposed transfer length limits") Signed-off-by: Fam Zheng <f...@redhat.com&g

[PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-27 Thread Fam Zheng
If device reports a small max_xfer_blocks and a zero opt_xfer_blocks, we end up using BLK_DEF_MAX_SECTORS, which is wrong and r/w of that size may get error. Fixes: ca369d51b3e ("block/sd: Fix device-imposed transfer length limits") Signed-off-by: Fam Zheng --- v2: Fix granularit

[PATCH] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-27 Thread Fam Zheng
If device reports a small max_xfer_blocks and a zero opt_xfer_blocks, we end up using BLK_DEF_MAX_SECTORS, which is wrong and r/w of that size may get error. Fixes: ca369d51b3e ("block/sd: Fix device-imposed transfer length limits") Signed-off-by: Fam Zheng <f...@redhat.com> -

[PATCH] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-27 Thread Fam Zheng
If device reports a small max_xfer_blocks and a zero opt_xfer_blocks, we end up using BLK_DEF_MAX_SECTORS, which is wrong and r/w of that size may get error. Fixes: ca369d51b3e ("block/sd: Fix device-imposed transfer length limits") Signed-off-by: Fam Zheng --- drivers/scsi/sd.c | 1

[PATCH v2 1/2] virtio_scsi: Add fc_host definitions

2017-01-25 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- include/uapi/linux/virtio_scsi.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/uapi/linux/virtio_scsi.h b/include/uapi/linux/virtio_scsi.h index cc18ef8..a26fb31 100644 --- a/include/uapi/linux/virtio_scsi.h +++ b/includ

[PATCH v2 1/2] virtio_scsi: Add fc_host definitions

2017-01-25 Thread Fam Zheng
Signed-off-by: Fam Zheng --- include/uapi/linux/virtio_scsi.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/uapi/linux/virtio_scsi.h b/include/uapi/linux/virtio_scsi.h index cc18ef8..a26fb31 100644 --- a/include/uapi/linux/virtio_scsi.h +++ b/include/uapi/linux/virtio_scsi.h

[PATCH v2 2/2] virtio_scsi: Implement fc_host

2017-01-25 Thread Fam Zheng
This implements the VIRTIO_SCSI_F_FC_HOST feature by reading the config fields and presenting them as sysfs fc_host attributes. The config change handler is added here because primary_active will toggle during migration. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/scsi/virtio_

[PATCH v2 0/2] virtio-scsi: Implement FC_HOST feature

2017-01-25 Thread Fam Zheng
v2: Fix endianness of WWNN/WWPN. [Paolo] This series implements the proposed fc_host feature of virtio-scsi. The first patch updates the data structure changes according to the spec proposal; the second patch actually implements the operations. Fam Zheng (2): virtio_scsi: Add fc_host

[PATCH v2 2/2] virtio_scsi: Implement fc_host

2017-01-25 Thread Fam Zheng
This implements the VIRTIO_SCSI_F_FC_HOST feature by reading the config fields and presenting them as sysfs fc_host attributes. The config change handler is added here because primary_active will toggle during migration. Signed-off-by: Fam Zheng --- drivers/scsi/virtio_scsi.c | 60

[PATCH v2 0/2] virtio-scsi: Implement FC_HOST feature

2017-01-25 Thread Fam Zheng
v2: Fix endianness of WWNN/WWPN. [Paolo] This series implements the proposed fc_host feature of virtio-scsi. The first patch updates the data structure changes according to the spec proposal; the second patch actually implements the operations. Fam Zheng (2): virtio_scsi: Add fc_host

Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.

2017-01-22 Thread Fam Zheng
On Wed, 01/18 15:28, Cathy Avery wrote: > Enable FC lightweight host option so that the luns exposed by > the driver may be manually scanned. Hi Cathy, out of curiosity: how does this relate to issue_lip operation? And how to trigger manual scan with this patch? Fam

Re: [PATCH 2/2] scsi: storvsc: Add support for FC lightweight host.

2017-01-22 Thread Fam Zheng
On Wed, 01/18 15:28, Cathy Avery wrote: > Enable FC lightweight host option so that the luns exposed by > the driver may be manually scanned. Hi Cathy, out of curiosity: how does this relate to issue_lip operation? And how to trigger manual scan with this patch? Fam

Re: [PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-17 Thread Fam Zheng
On Tue, 01/17 14:17, Paolo Bonzini wrote: > > > On 16/01/2017 18:26, Fam Zheng wrote: > >> Is the endianness correct for big-endian host here? > > > > I think so. The fc_host sysfs uses u64 to represent port_name and node_name, > > this patch does

Re: [PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-17 Thread Fam Zheng
On Tue, 01/17 14:17, Paolo Bonzini wrote: > > > On 16/01/2017 18:26, Fam Zheng wrote: > >> Is the endianness correct for big-endian host here? > > > > I think so. The fc_host sysfs uses u64 to represent port_name and node_name, > > this patch does

Re: [PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-16 Thread Fam Zheng
gt; https://github.com/0day-ci/linux/commits/Fam-Zheng/virtio-scsi-Implement-FC_HOST-feature/20170117-011950 > config: i386-randconfig-r0-201703 (attached as .config) > compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904 > reproduce: > # save the attached .config to linux build

Re: [PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-16 Thread Fam Zheng
gt; https://github.com/0day-ci/linux/commits/Fam-Zheng/virtio-scsi-Implement-FC_HOST-feature/20170117-011950 > config: i386-randconfig-r0-201703 (attached as .config) > compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904 > reproduce: > # save the attached .config to linux build

Re: [PATCH 0/2] virtio-scsi: Implement FC_HOST feature

2017-01-16 Thread Fam Zheng
On Mon, 01/16 09:34, Christoph Hellwig wrote: > On Tue, Jan 17, 2017 at 12:04:28AM +0800, Fam Zheng wrote: > > This series implements the proposed fc_host feature of virtio-scsi. > > Yikes. Why? Hi Christoph, this is mostly to "passthrough" a host NPIV vport (leavin

Re: [PATCH 0/2] virtio-scsi: Implement FC_HOST feature

2017-01-16 Thread Fam Zheng
On Mon, 01/16 09:34, Christoph Hellwig wrote: > On Tue, Jan 17, 2017 at 12:04:28AM +0800, Fam Zheng wrote: > > This series implements the proposed fc_host feature of virtio-scsi. > > Yikes. Why? Hi Christoph, this is mostly to "passthrough" a host NPIV vport (leavin

Re: [PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-16 Thread Fam Zheng
On Mon, 01/16 17:45, Paolo Bonzini wrote: > > > On 16/01/2017 17:04, Fam Zheng wrote: > > + node_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config, primary_wwnn)); > > + port_name = virtio_cread64(vdev, >

Re: [PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-16 Thread Fam Zheng
On Mon, 01/16 17:45, Paolo Bonzini wrote: > > > On 16/01/2017 17:04, Fam Zheng wrote: > > + node_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config, primary_wwnn)); > > + port_name = virtio_cread64(vdev, >

[PATCH 1/2] virtio_scsi: Add fc_host definitions

2017-01-16 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- include/uapi/linux/virtio_scsi.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/uapi/linux/virtio_scsi.h b/include/uapi/linux/virtio_scsi.h index cc18ef8..a26fb31 100644 --- a/include/uapi/linux/virtio_scsi.h +++ b/includ

[PATCH 1/2] virtio_scsi: Add fc_host definitions

2017-01-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- include/uapi/linux/virtio_scsi.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/uapi/linux/virtio_scsi.h b/include/uapi/linux/virtio_scsi.h index cc18ef8..a26fb31 100644 --- a/include/uapi/linux/virtio_scsi.h +++ b/include/uapi/linux/virtio_scsi.h

[PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-16 Thread Fam Zheng
This implements the VIRTIO_SCSI_F_FC_HOST feature by reading the config fields and presenting them as sysfs fc_host attributes. The config change handler is added here because primary_active will toggle during migration. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/scsi/virtio_

[PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-16 Thread Fam Zheng
This implements the VIRTIO_SCSI_F_FC_HOST feature by reading the config fields and presenting them as sysfs fc_host attributes. The config change handler is added here because primary_active will toggle during migration. Signed-off-by: Fam Zheng --- drivers/scsi/virtio_scsi.c | 55

[PATCH 0/2] virtio-scsi: Implement FC_HOST feature

2017-01-16 Thread Fam Zheng
This series implements the proposed fc_host feature of virtio-scsi. The first patch updates the data structure changes according to the spec proposal; the second patch actually implements the operations. Fam Zheng (2): virtio_scsi: Add fc_host definitions virtio_scsi: Implement fc_host

[PATCH 0/2] virtio-scsi: Implement FC_HOST feature

2017-01-16 Thread Fam Zheng
This series implements the proposed fc_host feature of virtio-scsi. The first patch updates the data structure changes according to the spec proposal; the second patch actually implements the operations. Fam Zheng (2): virtio_scsi: Add fc_host definitions virtio_scsi: Implement fc_host

[PATCH] libfc: Fix variable name in fc_set_wwpn

2017-01-12 Thread Fam Zheng
The parameter name should be wwpn instead of wwnn. Signed-off-by: Fam Zheng <f...@redhat.com> --- include/scsi/libfc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 96dd0b3..da5033d 100644 --- a/include/scsi/l

[PATCH] libfc: Fix variable name in fc_set_wwpn

2017-01-12 Thread Fam Zheng
The parameter name should be wwpn instead of wwnn. Signed-off-by: Fam Zheng --- include/scsi/libfc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 96dd0b3..da5033d 100644 --- a/include/scsi/libfc.h +++ b/include/scsi

Re: [PATCH] virtio-blk: Generate uevent after attribute available

2016-09-03 Thread Fam Zheng
On Sat, 09/03 01:56, Michael S. Tsirkin wrote: > On Wed, Jun 29, 2016 at 09:24:15AM +0800, Fam Zheng wrote: > > On Tue, 06/28 04:45, Christoph Hellwig wrote: > > > On Tue, Jun 28, 2016 at 10:39:15AM +0800, Fam Zheng wrote: > > > > Userspace listens to the KOBJ_AD

Re: [PATCH] virtio-blk: Generate uevent after attribute available

2016-09-03 Thread Fam Zheng
On Sat, 09/03 01:56, Michael S. Tsirkin wrote: > On Wed, Jun 29, 2016 at 09:24:15AM +0800, Fam Zheng wrote: > > On Tue, 06/28 04:45, Christoph Hellwig wrote: > > > On Tue, Jun 28, 2016 at 10:39:15AM +0800, Fam Zheng wrote: > > > > Userspace listens to the KOBJ_AD

Re: [PATCH 06/15] genhd: Add return code to device_add_disk

2016-08-17 Thread Fam Zheng
On Wed, 08/17 11:06, Cornelia Huck wrote: > On Wed, 17 Aug 2016 16:48:23 +0800 > Fam Zheng <f...@redhat.com> wrote: > > > On Wed, 08/17 10:49, Cornelia Huck wrote: > > > On Wed, 17 Aug 2016 15:15:06 +0800 > > > Fam Zheng <f...@redhat.com> wr

Re: [PATCH 06/15] genhd: Add return code to device_add_disk

2016-08-17 Thread Fam Zheng
On Wed, 08/17 11:06, Cornelia Huck wrote: > On Wed, 17 Aug 2016 16:48:23 +0800 > Fam Zheng wrote: > > > On Wed, 08/17 10:49, Cornelia Huck wrote: > > > On Wed, 17 Aug 2016 15:15:06 +0800 > > > Fam Zheng wrote: > > > > > > > @@ -613,1

Re: [PATCH 06/15] genhd: Add return code to device_add_disk

2016-08-17 Thread Fam Zheng
On Wed, 08/17 10:49, Cornelia Huck wrote: > On Wed, 17 Aug 2016 15:15:06 +0800 > Fam Zheng <f...@redhat.com> wrote: > > > @@ -613,10 +614,8 @@ void device_add_disk(struct device *parent, struct > > gendisk *disk) > > disk->flags |= GENHD_FL_UP; > &g

Re: [PATCH 06/15] genhd: Add return code to device_add_disk

2016-08-17 Thread Fam Zheng
On Wed, 08/17 10:49, Cornelia Huck wrote: > On Wed, 17 Aug 2016 15:15:06 +0800 > Fam Zheng wrote: > > > @@ -613,10 +614,8 @@ void device_add_disk(struct device *parent, struct > > gendisk *disk) > > disk->flags |= GENHD_FL_UP; > > &g

[PATCH 09/15] virtio-blk: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Meanwhile, handle error of device_add_disk. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/block/virtio_blk.c | 38 +++--- 1 file changed, 27 insertions(+), 11 deletions(-)

[PATCH 09/15] virtio-blk: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Meanwhile, handle error of device_add_disk. Signed-off-by: Fam Zheng --- drivers/block/virtio_blk.c | 38 +++--- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/drivers

[PATCH 08/15] nvme: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/nvme/host/core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 23a795f..1

[PATCH 07/15] genhd: Add attribute group parameter to device_add_disk

2016-08-17 Thread Fam Zheng
The added parameter attr_group, if not NULL, be added to the new disk. The callers are converted with coccinelle: @@ expression e1, e2; @@ - device_add_disk(e1, e2); + device_add_disk(e1, e2, NULL); So there is not behavior change yet. Signed-off-by: Fam Zheng <f...@redhat.

[PATCH 08/15] nvme: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Signed-off-by: Fam Zheng --- drivers/nvme/host/core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 23a795f..1921cb2 100644

[PATCH 07/15] genhd: Add attribute group parameter to device_add_disk

2016-08-17 Thread Fam Zheng
The added parameter attr_group, if not NULL, be added to the new disk. The callers are converted with coccinelle: @@ expression e1, e2; @@ - device_add_disk(e1, e2); + device_add_disk(e1, e2, NULL); So there is not behavior change yet. Signed-off-by: Fam Zheng --- arch/m68k/emu

[PATCH 11/15] zram: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Meanwhile, update the error check code and message. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/block/zram/zram_drv.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/bloc

[PATCH 06/15] genhd: Add return code to device_add_disk

2016-08-17 Thread Fam Zheng
There are a number of places in device_add_disk that can fail, and even more to come as we extend it. Switch the return type of the function, and return the error code when error happens. The WARN_ON is kept because callers are not updated to check the error yet. Signed-off-by: Fam Zheng &l

[PATCH 11/15] zram: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Meanwhile, update the error check code and message. Signed-off-by: Fam Zheng --- drivers/block/zram/zram_drv.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b

[PATCH 06/15] genhd: Add return code to device_add_disk

2016-08-17 Thread Fam Zheng
There are a number of places in device_add_disk that can fail, and even more to come as we extend it. Switch the return type of the function, and return the error code when error happens. The WARN_ON is kept because callers are not updated to check the error yet. Signed-off-by: Fam Zheng

[PATCH 05/15] genhd: Return error from disk_{add,alloc}_events

2016-08-17 Thread Fam Zheng
disk_alloc_events and disk_add_events can fail, return the error code so the caller can handle it. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/genhd.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/block/genhd.c b/block/genhd.c

[PATCH 05/15] genhd: Return error from disk_{add,alloc}_events

2016-08-17 Thread Fam Zheng
disk_alloc_events and disk_add_events can fail, return the error code so the caller can handle it. Signed-off-by: Fam Zheng --- block/genhd.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 8c7510d..4316d2d 100644

[PATCH 10/15] mtd: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/mtd/mtd_blkdevs.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 4

[PATCH 10/15] mtd: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Signed-off-by: Fam Zheng --- drivers/mtd/mtd_blkdevs.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 4ff9381..fc9265d 100644

[PATCH 13/15] aoeblk: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/block/aoe/aoeblk.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 4

[PATCH 12/15] mtip: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Meanwhile, update the error check code and message. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/block/mtip32xx/mtip32xx.c | 38 -- 1 file changed, 8 insertions(

[PATCH 13/15] aoeblk: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Signed-off-by: Fam Zheng --- drivers/block/aoe/aoeblk.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 4edfff2..d1b7541 100644

[PATCH 12/15] mtip: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Meanwhile, update the error check code and message. Signed-off-by: Fam Zheng --- drivers/block/mtip32xx/mtip32xx.c | 38 -- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git

[PATCH 15/15] block: Add FIXME comment to handle device_add_disk error

2016-08-17 Thread Fam Zheng
Done with coccinelle: @@ expression e1, e2, e3; identifier rc; @@ ( rc = device_add_disk(e1, e2, e3); | + /* FIXME: handle error. */ device_add_disk(e1, e2, e3); ) Signed-off-by: Fam Zheng <f...@redhat.com> --- arch/m68k/emu/nfblock.c | 1 + arch/um/d

[PATCH 15/15] block: Add FIXME comment to handle device_add_disk error

2016-08-17 Thread Fam Zheng
Done with coccinelle: @@ expression e1, e2, e3; identifier rc; @@ ( rc = device_add_disk(e1, e2, e3); | + /* FIXME: handle error. */ device_add_disk(e1, e2, e3); ) Signed-off-by: Fam Zheng --- arch/m68k/emu/nfblock.c | 1 + arch/um/drivers/ubd_kern.c

[PATCH 14/15] axonram: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Meanwhile, handle the error of device_add_disk. Signed-off-by: Fam Zheng <f...@redhat.com> --- arch/powerpc/sysdev/axonram.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git

[PATCH 14/15] axonram: Pass attribute group to device_add_disk

2016-08-17 Thread Fam Zheng
conditionally. device_add_disk can handle adding attribute group better, so use it. Meanwhile, handle the error of device_add_disk. Signed-off-by: Fam Zheng --- arch/powerpc/sysdev/axonram.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/sysdev

[PATCH 03/15] genhd: Return error from blk_register_region

2016-08-17 Thread Fam Zheng
blk_register_region can fail (-ENOMEM), return the error to the caller. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/genhd.c | 4 ++-- include/linux/genhd.h | 10 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/block/genhd.c b/block/genhd.c

[PATCH 03/15] genhd: Return error from blk_register_region

2016-08-17 Thread Fam Zheng
blk_register_region can fail (-ENOMEM), return the error to the caller. Signed-off-by: Fam Zheng --- block/genhd.c | 4 ++-- include/linux/genhd.h | 10 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 3dcecaa..8c7510d 100644

[PATCH 04/15] block: Return error from blk_integrity_add

2016-08-17 Thread Fam Zheng
The kobject_init_and_add call in blk_integrity_add can fail, return the error code in this case, so that it can be handled in the caller. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/blk-integrity.c | 12 include/linux/genhd.h | 4 ++-- 2 files changed, 10 insertions

[PATCH 02/15] genhd: Return error from register_disk()

2016-08-17 Thread Fam Zheng
Several operations in register_disk can fail, but the caller currently cannot check for error due to missing return code. Change the function return type and return -errno if any error happens. Also add some documentation. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/genhd.

[PATCH 04/15] block: Return error from blk_integrity_add

2016-08-17 Thread Fam Zheng
The kobject_init_and_add call in blk_integrity_add can fail, return the error code in this case, so that it can be handled in the caller. Signed-off-by: Fam Zheng --- block/blk-integrity.c | 12 include/linux/genhd.h | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions

[PATCH 02/15] genhd: Return error from register_disk()

2016-08-17 Thread Fam Zheng
Several operations in register_disk can fail, but the caller currently cannot check for error due to missing return code. Change the function return type and return -errno if any error happens. Also add some documentation. Signed-off-by: Fam Zheng --- block/genhd.c | 27

[PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes

2016-08-17 Thread Fam Zheng
FIXME comment where work is left). Fam Zheng (15): disk: Drop add_disk in favor of device_add_disk genhd: Return error from register_disk() genhd: Return error from blk_register_region block: Return error from blk_integrity_add genhd: Return error from disk_{add,alloc}_events genhd: Add

[PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes

2016-08-17 Thread Fam Zheng
FIXME comment where work is left). Fam Zheng (15): disk: Drop add_disk in favor of device_add_disk genhd: Return error from register_disk() genhd: Return error from blk_register_region block: Return error from blk_integrity_add genhd: Return error from disk_{add,alloc}_events genhd: Add

[PATCH 01/15] disk: Drop add_disk in favor of device_add_disk

2016-08-17 Thread Fam Zheng
f add_disk and update of related comments are done manually. Signed-off-by: Fam Zheng <f...@redhat.com> --- arch/m68k/emu/nfblock.c | 2 +- arch/xtensa/platforms/iss/simdisk.c | 2 +- drivers/block/DAC960.c | 2 +- drivers/block/amiflop.c | 2 +- drivers/bl

[PATCH 01/15] disk: Drop add_disk in favor of device_add_disk

2016-08-17 Thread Fam Zheng
f add_disk and update of related comments are done manually. Signed-off-by: Fam Zheng --- arch/m68k/emu/nfblock.c | 2 +- arch/xtensa/platforms/iss/simdisk.c | 2 +- drivers/block/DAC960.c | 2 +- drivers/block/amiflop.c | 2 +- drivers/block/aoe/aoeblk.c

Re: [PATCH v2 0/5] Add support for EPT execute only for nested hypervisors

2016-07-13 Thread Fam Zheng
On Wed, 07/13 11:20, Paolo Bonzini wrote: > > > On 13/07/2016 00:18, Bandan Das wrote: > > v1 of this series posted at https://lkml.org/lkml/2016/6/28/7 > > > > Changes since v1: > > - 1/5 : modify is_shadow_present_pte to check against 0x > >Reasoning provided in commit message. >

Re: [PATCH v2 0/5] Add support for EPT execute only for nested hypervisors

2016-07-13 Thread Fam Zheng
On Wed, 07/13 11:20, Paolo Bonzini wrote: > > > On 13/07/2016 00:18, Bandan Das wrote: > > v1 of this series posted at https://lkml.org/lkml/2016/6/28/7 > > > > Changes since v1: > > - 1/5 : modify is_shadow_present_pte to check against 0x > >Reasoning provided in commit message. >

Re: [PATCH v2 04/12] axonrom: Generate uevent after attribute available

2016-06-30 Thread Fam Zheng
On Thu, 06/30 15:10, Dan Williams wrote: > On Wed, Jun 29, 2016 at 6:59 PM, Fam Zheng <f...@redhat.com> wrote: > > It is documented that KOBJ_ADD should be generated after the object's > > attributes and children are ready. We can achieve this with the new > >

Re: [PATCH v2 04/12] axonrom: Generate uevent after attribute available

2016-06-30 Thread Fam Zheng
On Thu, 06/30 15:10, Dan Williams wrote: > On Wed, Jun 29, 2016 at 6:59 PM, Fam Zheng wrote: > > It is documented that KOBJ_ADD should be generated after the object's > > attributes and children are ready. We can achieve this with the new > > disk_gen_uevents interfac

Re: [PATCH v2 00/12] gendisk: Generate uevent after attribute available

2016-06-30 Thread Fam Zheng
On Wed, 06/29 23:38, Christoph Hellwig wrote: > On Thu, Jun 30, 2016 at 02:35:54PM +0800, Fam Zheng wrote: > > also more code and less flexible IMO. For example, we need at least two > > variants, for attribute_group and device_attribute separately, right? > > Yes, or

Re: [PATCH v2 00/12] gendisk: Generate uevent after attribute available

2016-06-30 Thread Fam Zheng
On Wed, 06/29 23:38, Christoph Hellwig wrote: > On Thu, Jun 30, 2016 at 02:35:54PM +0800, Fam Zheng wrote: > > also more code and less flexible IMO. For example, we need at least two > > variants, for attribute_group and device_attribute separately, right? > > Yes, or

Re: [PATCH v2 00/12] gendisk: Generate uevent after attribute available

2016-06-30 Thread Fam Zheng
On Wed, 06/29 23:24, Christoph Hellwig wrote: > On Thu, Jun 30, 2016 at 09:59:41AM +0800, Fam Zheng wrote: > > Documentation/kobject.txt: > > > Use the KOBJ_ADD action for when the kobject is first added to the kernel. > > > This should be done only after any attributes

Re: [PATCH v2 00/12] gendisk: Generate uevent after attribute available

2016-06-30 Thread Fam Zheng
On Wed, 06/29 23:24, Christoph Hellwig wrote: > On Thu, Jun 30, 2016 at 09:59:41AM +0800, Fam Zheng wrote: > > Documentation/kobject.txt: > > > Use the KOBJ_ADD action for when the kobject is first added to the kernel. > > > This should be done only after any attributes

[PATCH v2 02/12] genhd: Honor gen_uevent and add disk_gen_uevents

2016-06-29 Thread Fam Zheng
In add_disk(), don't send uevent to userspace when gen_uevent is true; also export the refactored function disk_gen_uevents for later use. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/genhd.c | 23 +++ include/linux/genhd.h | 1 + 2 files chang

[PATCH v2 02/12] genhd: Honor gen_uevent and add disk_gen_uevents

2016-06-29 Thread Fam Zheng
In add_disk(), don't send uevent to userspace when gen_uevent is true; also export the refactored function disk_gen_uevents for later use. Signed-off-by: Fam Zheng --- block/genhd.c | 23 +++ include/linux/genhd.h | 1 + 2 files changed, 20 insertions(+), 4

[PATCH v2 08/12] zram: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
It is documented that KOBJ_ADD should be generated after the object's attributes and children are ready. We can achieve this with the new disk_gen_uevents interface. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/block/zram/zram_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

[PATCH v2 08/12] zram: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
It is documented that KOBJ_ADD should be generated after the object's attributes and children are ready. We can achieve this with the new disk_gen_uevents interface. Signed-off-by: Fam Zheng --- drivers/block/zram/zram_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v2 07/12] pktcdvd: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
It is documented that KOBJ_ADD should be generated after the object's attributes and children are ready. We can achieve this with the new disk_gen_uevents interface. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/block/pktcdvd.c | 4 +++- 1 file changed, 3 insertions(+), 1 de

[PATCH v2 07/12] pktcdvd: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
It is documented that KOBJ_ADD should be generated after the object's attributes and children are ready. We can achieve this with the new disk_gen_uevents interface. Signed-off-by: Fam Zheng --- drivers/block/pktcdvd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v2 04/12] axonrom: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
It is documented that KOBJ_ADD should be generated after the object's attributes and children are ready. We can achieve this with the new disk_gen_uevents interface. Signed-off-by: Fam Zheng <f...@redhat.com> --- arch/powerpc/sysdev/axonram.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

[PATCH v2 03/12] virtio-blk: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
of virtio-blk disks. Also in systemd, there used to be a related workaround in udev rules called 'WAIT_FOR="serial"', but it is removed in later versions. Now let's generate a KOBJ_CHANGE event after the attributes are ready. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/bl

[PATCH v2 04/12] axonrom: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
It is documented that KOBJ_ADD should be generated after the object's attributes and children are ready. We can achieve this with the new disk_gen_uevents interface. Signed-off-by: Fam Zheng --- arch/powerpc/sysdev/axonram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v2 03/12] virtio-blk: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
of virtio-blk disks. Also in systemd, there used to be a related workaround in udev rules called 'WAIT_FOR="serial"', but it is removed in later versions. Now let's generate a KOBJ_CHANGE event after the attributes are ready. Signed-off-by: Fam Zheng --- drivers/block/virtio_blk.c | 3 +

[PATCH v2 10/12] mmc: Generate uevent after attribute available

2016-06-29 Thread Fam Zheng
It is documented that KOBJ_ADD should be generated after the object's attributes and children are ready. We can achieve this with the new disk_gen_uevents interface. Signed-off-by: Fam Zheng <f...@redhat.com> --- drivers/mmc/card/block.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

  1   2   3   4   >