From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f193.google.com ([209.85.166.193]:36458 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726113AbeJZXGU (ORCPT ); Fri, 26 Oct 2018 19:06:20 -0400 Received: by mail-it1-f193.google.com with SMTP id h14-v6so1896924itf.1 for ; Fri, 26 Oct 2018 07:29:03 -0700 (PDT) Subject: Re: [PATCH] direct-io: allow direct writes to empty inodes To: Jan Kara , =?UTF-8?Q?Ernesto_A=2e_Fern=c3=a1ndez?= Cc: linux-fsdevel@vger.kernel.org, Alexander Viro References: <20181008235823.5rpr4dqgriiacsvy@eaf> <20181026093004.GA25227@quack2.suse.cz> From: Jens Axboe Message-ID: <906a14c3-0b0c-8591-6269-219316d4bdfa@kernel.dk> Date: Fri, 26 Oct 2018 08:29:00 -0600 MIME-Version: 1.0 In-Reply-To: <20181026093004.GA25227@quack2.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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? -- Jens Axboe