Return-Path: Received: from mail-qt1-f195.google.com ([209.85.160.195]:46830 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726521AbfAGSDQ (ORCPT ); Mon, 7 Jan 2019 13:03:16 -0500 Received: by mail-qt1-f195.google.com with SMTP id y20so1408599qtm.13 for ; Mon, 07 Jan 2019 10:03:15 -0800 (PST) Date: Mon, 7 Jan 2019 15:03:08 -0300 From: Ernesto =?utf-8?Q?A=2E_Fern=C3=A1ndez?= To: Jens Axboe Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Alexander Viro , Jeff Moyer Subject: Re: [PATCH] direct-io: allow direct writes to empty inodes Message-ID: <20190107180308.gsnqimqmmabwnwfc@eaf> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <11f495f4-c51d-4676-f539-019b4006cbad@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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? > > -- > Jens Axboe >