From: Linus Torvalds Date: Tue, 10 Aug 2010 22:22:42 +0000 (-0700) Subject: Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block X-Git-Tag: v2.6.36-rc1~288 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=2f9e825d3e0e2b407ae8f082de5c00afcf7378fb Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block * 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits) block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n xen-blkfront: fix missing out label blkdev: fix blkdev_issue_zeroout return value block: update request stacking methods to support discards block: fix missing export of blk_types.h writeback: fix bad _bh spinlock nesting drbd: revert "delay probes", feature is being re-implemented differently drbd: Initialize all members of sync_conf to their defaults [Bugz 315] drbd: Disable delay probes for the upcomming release writeback: cleanup bdi_register writeback: add new tracepoints writeback: remove unnecessary init_timer call writeback: optimize periodic bdi thread wakeups writeback: prevent unnecessary bdi threads wakeups writeback: move bdi threads exiting logic to the forker thread writeback: restructure bdi forker loop a little writeback: move last_active to bdi writeback: do not remove bdi from bdi_list writeback: simplify bdi code a little writeback: do not lose wake-ups in bdi threads ... Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and drivers/scsi/scsi_error.c as per Jens. --- 2f9e825d3e0e2b407ae8f082de5c00afcf7378fb diff --cc drivers/block/virtio_blk.c index 23b7c48df843,7b0f7b624adf..2aafafca2b13 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@@ -377,32 -377,11 +388,31 @@@ static int __devinit virtblk_probe(stru vblk->disk->driverfs_dev = &vdev->dev; index++; - /* If barriers are supported, tell block layer that queue is ordered */ - if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH)) + if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH)) { + /* + * If the FLUSH feature is supported we do have support for + * flushing a volatile write cache on the host. Use that + * to implement write barrier support. + */ - blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH, - virtblk_prepare_flush); + blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH); - else if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER)) + } else if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER)) { + /* + * If the BARRIER feature is supported the host expects us + * to order request by tags. This implies there is not + * volatile write cache on the host, and that the host + * never re-orders outstanding I/O. This feature is not + * useful for real life scenarious and deprecated. + */ - blk_queue_ordered(q, QUEUE_ORDERED_TAG, NULL); + blk_queue_ordered(q, QUEUE_ORDERED_TAG); + } else { + /* + * If the FLUSH feature is not supported we must assume that + * the host does not perform any kind of volatile write + * caching. We still need to drain the queue to provider + * proper barrier semantics. + */ - blk_queue_ordered(q, QUEUE_ORDERED_DRAIN, NULL); ++ blk_queue_ordered(q, QUEUE_ORDERED_DRAIN); + } /* If disk is read-only in the host, the guest should obey */ if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO)) diff --cc drivers/ide/ide-cd.c index 2de76cc08f61,5108e9739c96..31fc76960a8f --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@@ -686,11 -681,10 +688,11 @@@ out_end } if (uptodate == 0 && rq->bio) - ide_cd_error_cmd(drive, cmd); + if (ide_cd_error_cmd(drive, cmd)) + return ide_stopped; /* make sure it's fully ended */ - if (blk_fs_request(rq) == 0) { + if (rq->cmd_type != REQ_TYPE_FS) { rq->resid_len -= cmd->nbytes - cmd->nleft; if (uptodate == 0 && (cmd->tf_flags & IDE_TFLAG_WRITE)) rq->resid_len += cmd->last_xfer_len; diff --cc drivers/scsi/scsi_error.c index 2bf98469dc4c,2768bf6ffe59..bbbc186dbc1a --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@@ -307,33 -307,7 +307,33 @@@ static int scsi_check_sense(struct scsi (sshdr.asc == 0x04) && (sshdr.ascq == 0x02)) return FAILED; - return NEEDS_RETRY; + if (sshdr.asc == 0x3f && sshdr.ascq == 0x0e) + scmd_printk(KERN_WARNING, scmd, + "Warning! Received an indication that the " + "LUN assignments on this target have " + "changed. The Linux SCSI layer does not " + "automatically remap LUN assignments.\n"); + else if (sshdr.asc == 0x3f) + scmd_printk(KERN_WARNING, scmd, + "Warning! Received an indication that the " + "operating parameters on this target have " + "changed. The Linux SCSI layer does not " + "automatically adjust these parameters.\n"); + - if (blk_barrier_rq(scmd->request)) ++ if (scmd->request->cmd_flags & REQ_HARDBARRIER) + /* + * barrier requests should always retry on UA + * otherwise block will get a spurious error + */ + return NEEDS_RETRY; + else + /* + * for normal (non barrier) commands, pass the + * UA upwards for a determination in the + * completion functions + */ + return SUCCESS; + /* these three are not supported */ case COPY_ABORTED: case VOLUME_OVERFLOW: diff --cc drivers/scsi/sd.c index cc8a1d1d915a,108daead7ae8..8e2e893db9e7 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@@ -2367,11 -2399,10 +2408,12 @@@ static int sd_remove(struct device *dev { struct scsi_disk *sdkp; - async_synchronize_full(); sdkp = dev_get_drvdata(dev); + scsi_autopm_get_device(sdkp->device); + + async_synchronize_full(); blk_queue_prep_rq(sdkp->device->request_queue, scsi_prep_fn); + blk_queue_unprep_rq(sdkp->device->request_queue, NULL); device_del(&sdkp->dev); del_gendisk(sdkp->disk); sd_shutdown(dev); diff --cc include/linux/fs.h index a8ccf85b8691,c53911277210..1542e0e52b2e --- a/include/linux/fs.h +++ b/include/linux/fs.h @@@ -2263,9 -2267,18 +2265,8 @@@ static inline int xip_truncate_page(str #endif #ifdef CONFIG_BLOCK - struct bio; typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, loff_t file_offset); -void dio_end_io(struct bio *bio, int error); - -ssize_t __blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, struct inode *inode, - struct block_device *bdev, const struct iovec *iov, loff_t offset, - unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, - dio_submit_t submit_io, int lock_type); -ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, - struct block_device *bdev, const struct iovec *iov, loff_t offset, - unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, - dio_submit_t submit_io, int lock_type); enum { /* need locking between buffered and direct access */