From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FE2DC433DB for ; Thu, 7 Jan 2021 12:44:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5A872336D for ; Thu, 7 Jan 2021 12:44:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728370AbhAGMoS (ORCPT ); Thu, 7 Jan 2021 07:44:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29820 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728173AbhAGMoN (ORCPT ); Thu, 7 Jan 2021 07:44:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610023367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C8GYXHjWTOh0UH/y8ZgnKRJ27aQdFgDUIcHSJBqDdrQ=; b=FN+tmX2VCg5KKfPKLCnRhT+I8nvYkLMRfTfB9K9gXJjJqdE/pmb1RbPf53Bcirw1n8XE7F prPr5v9umZSk3M2HmicXrfAw2GznBM7li2E/Nf6OK+hqxXjBgW8qbr+MEJAo4KkL4nXwF1 u91f/IcpRcPa7VfbT8YiWGUtOhp+WKQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-297-kiCDWx76MyOkIl7t4s2Hjw-1; Thu, 07 Jan 2021 07:42:45 -0500 X-MC-Unique: kiCDWx76MyOkIl7t4s2Hjw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 955A119251A9; Thu, 7 Jan 2021 12:42:44 +0000 (UTC) Received: from starship (unknown [10.35.206.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id D95AF5B6A2; Thu, 7 Jan 2021 12:42:42 +0000 (UTC) Message-ID: <389f04288690b44b0ea6c977894dc0592e904c90.camel@redhat.com> Subject: Re: [PATCH] block: fallocate: avoid false positive on collision detection From: Maxim Levitsky To: linux-kernel@vger.kernel.org Cc: "Darrick J . Wong" , Alexander Viro , "open list:FILESYSTEMS (VFS and infrastructure)" , Jan Kara Date: Thu, 07 Jan 2021 14:42:41 +0200 In-Reply-To: <20210107124022.900172-1-mlevitsk@redhat.com> References: <45420b24124b5b91bc0a80a4abad2e06acb8c2b3.camel@redhat.com> <20210107124022.900172-1-mlevitsk@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-01-07 at 14:40 +0200, Maxim Levitsky wrote: > Align start and end on page boundaries before calling > invalidate_inode_pages2_range. > > This might allow us to miss a collision if the write and the discard were done > to the same page and do overlap but it is still better than returning -EBUSY > if those writes didn't overlap. > > Signed-off-by: Maxim Levitsky This is my attempt to fix this issue. I am not 100% sure that this is the right solution though. Any feedback is welcome! Best regards, Maxim Levitsky