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=-4.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED 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 C3781C282C4 for ; Tue, 22 Jan 2019 15:27:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93704217F4 for ; Tue, 22 Jan 2019 15:27:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="Gl2mXcwJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729956AbfAVP1R (ORCPT ); Tue, 22 Jan 2019 10:27:17 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:34302 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729920AbfAVP1N (ORCPT ); Tue, 22 Jan 2019 10:27:13 -0500 Received: by mail-it1-f194.google.com with SMTP id x124so9899622itd.1 for ; Tue, 22 Jan 2019 07:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hOROua08BNnXGiwNMaJM5ZIv0EM+Mazx58EWDe5q1FI=; b=Gl2mXcwJ/Nv0X7KEGv58PnEel5Iw1accS8V91aYtnZNKSU57I0IaLaYd50NJYTpUyV u2wpBaPv+b+aajCa3DyTpqqaqyEL1+8kD/OkpfxjZ7wMmxW0KfyV4+LTat97h5A7jHde njzPer78JUKuj4NnAyRDmz5W23IrsOuY5vp70+SVXYFJJZvpkRmCHzQhTtybbypSwmHD nIaaub++icwjaSptVc3P5ZsiLAPEVslOylnz3gC5LeKtC/b7/T1OG43tQvNOcPSN/xBy eBtlMbMGHXxxnkrFE/L3jYjo2wmq934EyHdCJSHu3xskdvgqDVHXhBc+9YXumDz3/k8q gJpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hOROua08BNnXGiwNMaJM5ZIv0EM+Mazx58EWDe5q1FI=; b=CPnmf4dZPFTDHJbb3kH512n+3tmY1I5Ksf5+n7eC1ehailZC2b1TUcXIH2a7c1tRXn RjiLe4duL4tT6SJk2Nly4FEFNYkqINE794buYbG9qZTBQIoA/3bEAHkjqR0gUrv94Dkh cfTSBjecx4RRmbhfoUMeQEx/JwRW0HC1cEWTaai0Taqp/Vn9V1KwcGQOKgDm30P08tL3 iIdrc4bewr/q86d8ors5fC34biKpQrMw/d9TXcEBwyiTWGKWu0y13Q4jOsFLpApRsI7E guYSGCMNT73Fg7WAGFFCNEMqB8t7odOVkrATr7rgSM0Sx7BoQKboLMoxTk3O73y++NTg f4lA== X-Gm-Message-State: AJcUukfdVCEMLvHrGnVxwkSnNHQJQ73YVCXZlRrZPfB3804+Uv0urOdj cTrQqbwDewv5knggu5qAokvhTQ== X-Google-Smtp-Source: ALg8bN72SJHi64JSCm1T0OdmB9weTLdtRleC+Z8Y4vXelQvinGuYoqKYMpPBxa2xyXevrvQUE77O+w== X-Received: by 2002:a02:54c4:: with SMTP id t187mr6739561jaa.51.1548170833051; Tue, 22 Jan 2019 07:27:13 -0800 (PST) Received: from [192.168.1.158] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id k4sm6185447ion.61.2019.01.22.07.27.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 07:27:12 -0800 (PST) Subject: Re: [PATCH] direct-io: allow direct writes to empty inodes To: =?UTF-8?Q?Ernesto_A=2e_Fern=c3=a1ndez?= Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Alexander Viro , Jeff Moyer References: <20181008235823.5rpr4dqgriiacsvy@eaf> <20181026093004.GA25227@quack2.suse.cz> <906a14c3-0b0c-8591-6269-219316d4bdfa@kernel.dk> <20181027041205.ui6j3awevfttozgf@eaf> <11f495f4-c51d-4676-f539-019b4006cbad@kernel.dk> <20190107180308.gsnqimqmmabwnwfc@eaf> <20190122000421.cmzcshm2kbe5jcfw@eaf> From: Jens Axboe Message-ID: Date: Tue, 22 Jan 2019 08:27:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190122000421.cmzcshm2kbe5jcfw@eaf> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 1/21/19 5:04 PM, Ernesto A. Fernández wrote: > On Mon, Jan 07, 2019 at 03:03:08PM -0300, Ernesto A. Fernández wrote: >> On Sat, Oct 27, 2018 at 10:54:09AM -0600, Jens Axboe wrote: >>> On 10/26/18 10:12 PM, Ernesto A. Fernández wrote: >>>> On Fri, Oct 26, 2018 at 08:29:00AM -0600, Jens Axboe wrote: >>>>> On 10/26/18 3:30 AM, Jan Kara wrote: >>>>>> On Mon 08-10-18 20:58:23, Ernesto A. Fernández wrote: >>>>>>> On a DIO_SKIP_HOLES filesystem, the ->get_block() method is currently >>>>>>> not allowed to create blocks for an empty inode. This confusion comes >>>>>>> from trying to bit shift a negative number, so check the size of the >>>>>>> inode first. >>>>>>> >>>>>>> The problem is most visible for hfsplus, because the fallback to >>>>>>> buffered I/O doesn't happen and the write fails with EIO. This is in >>>>>>> part the fault of the module, because it gives a wrong return value on >>>>>>> ->get_block(); that will be fixed in a separate patch. >>>>>>> >>>>>>> Signed-off-by: Ernesto A. Fernández >>>>>> >>>>>> Good catch. The patch looks good. You can add: >>>>>> >>>>>> Reviewed-by: Jan Kara >>>>>> >>>>>> Also Jens often picks up patches for direct IO code so added him to CC. >>>>>> Jens? >>>>> >>>>> Looks good to me. Ernesto, did you run this through xfstests as well? >>>> >>>> I only ran the quick tests for ext2. Also for hfsplus, but those are not >>>> very meaningful because too many are failing. >>> >>> OK, that's useful. I'll run it through the whole thing just in case, >>> but I don't expect to find anything. >> >> So what happened with this patch? Any issues? > > Ping? Sorry, I dropped this one on the floor. Now queued up, thanks for the ping! -- Jens Axboe