Identified Fault within 7 changes
commit b8d8bdfe31a67981bbc398a4886ccc67aff521d5 Merge: 4c823cc 6927d92 Author: Jens Axboe <ax...@kernel.dk> Date: Thu Oct 20 15:10:59 2011 +0200
Merge branch 'stable/for-jens-3.2' of git://oss.oracle.com/git/kwilk/xen into for-3.2/drivers commit 6927d92091df2848fc0e6a693a017d4b2df549c2 Author: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Date: Mon Oct 17 14:27:48 2011 -0400 xen/blkback: Fix two races in the handling of barrier requests. There are two windows of opportunity to cause a race when processing a barrier request. This patch fixes this. Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit dda1852802a6cc6fdecb9021e491b2de680c76b9 Author: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Date: Fri Oct 14 12:13:05 2011 -0400 xen/blkback: Check for proper operation. The patch titled: "xen/blkback: Fix the inhibition to map pages when discarding sector ranges." had the right idea except that it used the wrong comparison operator. It had == instead of !=. This fixes the bug where all (except discard) operations would have been ignored. Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit 64391b2536ca92f9c589b2bfeaca3954896fe057 Author: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Date: Mon Oct 10 00:47:49 2011 -0400 xen/blkback: Fix the inhibition to map pages when discarding sector ranges. The 'operation' parameters are the ones provided to the bio layer while the req->operation are the ones passed in between the backend and frontend. We used the wrong 'operation' value to squash the call to map pages when processing the discard operation resulting in an hypercall that did nothing. Lets guard against going in the mapping function by checking for the proper operation type. CC: Li Dongyang <lidongy...@novell.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit 5c62cb48602dba95159c81ffeca179d3852e25be Author: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Date: Mon Oct 10 12:33:21 2011 -0400 xen/blkback: Report VBD_WSECT (wr_sect) properly. We did not increment the amount of sectors written to disk b/c we tested for the == WRITE which is incorrect - as the operations are more of WRITE_FLUSH, WRITE_ODIRECT. This patch fixes it by doing a & WRITE check. CC: sta...@kernel.org Reported-by: Andy Burns <xen.li...@burns.me.uk> Suggested-by: Ian Campbell <ian.campb...@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit 29bde093787f3bdf7b9b4270ada6be7c8076e36b Author: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Date: Mon Oct 10 00:42:22 2011 -0400 xen/blkback: Support 'feature-barrier' aka old-style BARRIER requests. We emulate the barrier requests by draining the outstanding bio's and then sending the WRITE_FLUSH command. To drain the I/Os we use the refcnt that is used during disconnect to wait for all the I/Os before disconnecting from the frontend. We latch on its value and if it reaches either the threshold for disconnect or when there are no more outstanding I/Os, then we have drained all I/Os. Suggested-by: Christopher Hellwig <h...@infradead.org> Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit 469738e675524b6aa029ecd46bdda3f878b12eff Author: Laszlo Ersek <ler...@redhat.com> Date: Fri Oct 7 21:34:38 2011 +0200 xen-blkfront: plug device number leak in xlblk_init() error path ... though after a failed xenbus_register_frontend() all may be lost. Acked-by: Ian Campbell <ian.campb...@citrix.com> Signed-off-by: Laszlo Ersek <ler...@redhat.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit d11e6158307bed3f178399a4e6216eec67d16200 Author: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Date: Fri Sep 16 15:15:14 2011 -0400 xen-blkfront: If no barrier or flush is supported, use invalid operation. Guard against issuing BLKIF_OP_WRITE_BARRIER or BLKIF_OP_FLUSH_CACHE by checking whether we successfully negotiated with the backend. The negotiation with the backend also sets the q->flush_flags which fortunately for us is also used when submitting an bio to us. If we don't support barriers or flushes it would be set to zero so we should never end up having to deal with REQ_FLUSH | REQ_FUA. However, other third party implementations of __make_request that might be stacked on top of us might not be so smart, so lets fix this up. Acked-by: Jan Beulich <jbeul...@suse.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit 8e6dc6fe51957116d363204a725c1262b4b78e19 Author: Jan Beulich <jbeul...@suse.com> Date: Fri Sep 16 08:38:09 2011 +0100 xen-blkback: use kzalloc() in favor of kmalloc()+memset() This fixes the problem of three of those four memset()-s having improper size arguments passed: Sizeof a pointer-typed expression returns the size of the pointer, not that of the pointed to data. It also reverts using kmalloc() instead of kzalloc() for the allocation of the pending grant handles array, as that array gets fully initialized in a subsequent loop. Reported-by: Julia Lawall <ju...@diku.dk> Signed-off-by: Jan Beulich <jbeul...@novell.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit c555aab97de139ac8762c922248bb68f43a8c488 Author: Joe Jin <joe....@oracle.com> Date: Mon Aug 15 12:57:07 2011 +0800 xen-blkback: fixed indentation and comments This patch fixes belows: 1. Fix code style issue. 2. Fix incorrect functions name in comments. Signed-off-by: Joe Jin <joe....@oracle.com> Cc: Jens Axboe <jax...@fusionio.com> Cc: Ian Campbell <ian.campb...@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit 69ef68cef961a934c35308843a04b26d91cad4a8 Author: Li Dongyang <lidongy...@novell.com> Date: Wed Sep 14 14:02:40 2011 +0800 xen-blkfront: fix a deadlock while handling discard response When we get -EOPNOTSUPP response for a discard request, we will clear the discard flag on the request queue so we won't attempt to send discard requests to backend again, and this should be protected under rq->queue_lock. However, when we setup the request queue, we pass blkif_io_lock to blk_init_queue so rq->queue_lock is blkif_io_lock indeed, and this lock is already taken when we are in blkif_interrpt, so remove the spin_lock/spin_unlock when we clear the discard flag or we will end up with deadlock here Signed-off-by: Li Dongyang <lidongy...@novell.com> [v1: Updated description a bit and removed comment from source] Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit ed30bf317c5ceb25166cdbce3e0b35e33c82b509 Author: Li Dongyang <lidongy...@novell.com> Date: Thu Sep 1 18:39:09 2011 +0800 xen-blkfront: Handle discard requests. If the backend advertises 'feature-discard', then interrogate the backend for alignment and granularity. Setup the request queue with the appropiate values and send the discard operation as required. Signed-off-by: Li Dongyang <lidongy...@novell.com> [v1: Amended commit description] Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit b3cb0d6adc4bbc70b5e37e49a6068e973545ead7 Author: Li Dongyang <lidongy...@novell.com> Date: Thu Sep 1 18:39:10 2011 +0800 xen-blkback: Implement discard requests ('feature-discard') ..aka ATA TRIM/SCSI UNMAP command to be passed through the frontend and used as appropiately by the backend. We also advertise certain granulity parameters to the frontend so it can plug them in. If the backend is a realy device - we just end up using 'blkdev_issue_discard' while for loopback devices - we just punch a hole in the image file. Signed-off-by: Li Dongyang <lidongy...@novell.com> [v1: Fixed up pr_debug and commit description] Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit 32a8d26cc9b96629269e04ee6c583e14398f6f47 Author: Li Dongyang <lidongy...@novell.com> Date: Thu Sep 1 18:39:08 2011 +0800 xen-blkfront: add BLKIF_OP_DISCARD and discard request struct Now we use BLKIF_OP_DISCARD and add blkif_request_discard to blkif_request union, the patch is taken from Owen Smith and Konrad, Thanks Signed-off-by: Owen Smith <owen.sm...@citrix.com> Signed-off-by: Li Dongyang <lidongy...@novell.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> commit 4c823cc3d568277aa6340d8df6981e34f4c4dee5 Author: Ayan George <a...@ayan.net> Date: Wed Sep 21 10:02:13 2011 +0200 drivers/block/loop.c: remove unnecessary bdev argument from loop_clr_fd() If the loop device is associated (lo->lo_state == Lo_bound), it will have a valid bdev pointed to by lo->lo_device. There is no reason to ever pass an additional block_device pointer. Signed-off-by: Ayan George <ayan.geo...@canonical.com> Cc: Phillip Susi <ps...@cfl.rr.com> Cc: Jens Axboe <ax...@kernel.dk> Signed-off-by: Andrew Morton <a...@google.com> Signed-off-by: Jens Axboe <ax...@kernel.dk>