From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [PATCH] blkdev: Do not return -EOPNOTSUPP if discard is supported Date: Fri, 6 May 2011 19:30:32 -0600 Message-ID: <4DC4A0B8.7060801@fusionio.com> References: <1304345841-20063-1-git-send-email-lczerner@redhat.com> <1304608365-17199-1-git-send-email-lczerner@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jeff Moyer To: Lukas Czerner Return-path: In-Reply-To: <1304608365-17199-1-git-send-email-lczerner@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 2011-05-05 09:12, Lukas Czerner wrote: > Currently we return -EOPNOTSUPP in blkdev_issue_discard() if any of the > bio fails due to underlying device not supporting discard request. > However, if the device is for example dm device composed of devices > which some of them support discard and some of them does not, it is ok > for some bios to fail with EOPNOTSUPP, but it does not mean that discard > is not supported at all. > > This commit removes the check for bios failed with EOPNOTSUPP and change > blkdev_issue_discard() to return operation not supported if and only if > the device does not actually supports it, not just part of the device as > some bios might indicate. > > This change also fixes problem with BLKDISCARD ioctl() which now works > correctly on such dm devices. Applied, thanks. -- Jens Axboe