From: David Woodhouse Subject: Re: [PATCH 0/7] Discard requests, v2 Date: Wed, 13 Aug 2008 13:07:02 +0100 Message-ID: <1218629222.2977.278.camel@pmac.infradead.org> References: <20080812091446.GF20055@kernel.dk> <1218535205.2977.131.camel@pmac.infradead.org> <20080812105428.GG20055@kernel.dk> <1218539797.2977.147.camel@pmac.infradead.org> <1218543544.2977.158.camel@pmac.infradead.org> <20080812125315.GH20055@kernel.dk> <1218546257.2977.167.camel@pmac.infradead.org> <1218556054.2977.188.camel@pmac.infradead.org> <20080813111547.GZ20055@kernel.dk> <1218626628.2977.266.camel@pmac.infradead.org> <20080813113220.GC20055@kernel.dk> <1218627286.2977.269.camel@pmac.infradead.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Andrew Morton , Ric Wheeler , linux-fsdevel@vger.kernel.org, gilad@codefidence.com, matthew@wil.cx To: Jens Axboe Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:40532 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751848AbYHMMHS (ORCPT ); Wed, 13 Aug 2008 08:07:18 -0400 In-Reply-To: <1218627286.2977.269.camel@pmac.infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 2008-08-13 at 12:34 +0100, David Woodhouse wrote: > Er, yes. That would be a good idea, wouldn't it? :) > > Hold off on pulling the tree for a moment; I'll do that. Merged this into the appropriate commit: --- a/block/ioctl.c +++ b/block/ioctl.c @@ -325,6 +325,9 @@ int blkdev_ioctl(struct inode *inode, struct file *file, uns case BLKDISCARD: { uint64_t range[2]; + if (!(file->f_mode & FMODE_WRITE)) + return -EBADF; + if (copy_from_user(range, (void __user *)arg, sizeof(range))) return -EFAULT; Please pull (I've left out the REQ_TYPE_FLUSH patch for now)... The following changes since commit 6dc2b733b2f9605b48fdb7692fce5a3eafe241e4: Jens Axboe (1): highmem: use bio_has_data() in the bounce path are available in the git repository at: git://git.infradead.org/users/dwmw2/discard-2.6.git master David Woodhouse (10): [BLOCK] Fix typo causing compile error in blk_queue_bounce() [BLOCK] Fix up comments about matching flags between bio and rq [BLOCK] Add 'discard' request handling [FAT] Let the block device know when sectors can be discarded [MTD] Support 'discard sectors' operation in translation layer support core [MTD] [FTL] Support 'discard sectors' operation. blktrace: support discard requests blktrace: simplify flags handling in __blk_add_trace [BLOCK] Add BLKDISCARD ioctl to allow userspace to discard sectors [BLOCK] Allow elevators to sort/merge discard requests OGAWA Hirofumi (1): [BLOCK] Use WRITE_BARRIER in blkdev_issue_flush(), not (1<