Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965316AbeALWoq (ORCPT + 1 other); Fri, 12 Jan 2018 17:44:46 -0500 Received: from mail.linux-iscsi.org ([67.23.28.174]:56369 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965236AbeALWop (ORCPT ); Fri, 12 Jan 2018 17:44:45 -0500 X-Greylist: delayed 381 seconds by postgrey-1.27 at vger.kernel.org; Fri, 12 Jan 2018 17:44:45 EST Message-ID: <1515796702.21541.7.camel@haakon3.daterainc.com> Subject: Re: [PATCH] target: don't call an unmap callback if a range length is zero From: "Nicholas A. Bellinger" To: Andrei Vagin Cc: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 12 Jan 2018 14:38:22 -0800 In-Reply-To: <20171213215513.26416-1-avagin@openvz.org> References: <20171213215513.26416-1-avagin@openvz.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Andrei, Apologies for the delayed follow up. On Wed, 2017-12-13 at 13:55 -0800, Andrei Vagin wrote: > If a length of a range is zero, it means there is nothing to unmap > and we can skip this range. > > Here is one more reason, why we have to skip such ranges. An unmap > callback calls file_operations->fallocate(), but the man page for the > fallocate syscall says that fallocate(fd, mode, offset, let) returns > EINVAL, if len is zero. It means that file_operations->fallocate() isn't > obligated to handle zero ranges too. > > Signed-off-by: Andrei Vagin > --- > drivers/target/target_core_sbc.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > Applied. Thank you.