Return-Path: Received: from mail-qt1-f193.google.com ([209.85.160.193]:41243 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726565AbeJ0Mvv (ORCPT ); Sat, 27 Oct 2018 08:51:51 -0400 Received: by mail-qt1-f193.google.com with SMTP id l41-v6so3588172qtl.8 for ; Fri, 26 Oct 2018 21:12:13 -0700 (PDT) Date: Sat, 27 Oct 2018 01:12:06 -0300 From: Ernesto =?utf-8?Q?A=2E_Fern=C3=A1ndez?= To: Jens Axboe Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Alexander Viro Subject: Re: [PATCH] direct-io: allow direct writes to empty inodes Message-ID: <20181027041205.ui6j3awevfttozgf@eaf> References: <20181008235823.5rpr4dqgriiacsvy@eaf> <20181026093004.GA25227@quack2.suse.cz> <906a14c3-0b0c-8591-6269-219316d4bdfa@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <906a14c3-0b0c-8591-6269-219316d4bdfa@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. > > -- > Jens Axboe >