]> Git Repo - linux.git/commit
direct-io: allow direct writes to empty inodes
authorErnesto A. Fernández <[email protected]>
Mon, 8 Oct 2018 23:58:23 +0000 (20:58 -0300)
committerJens Axboe <[email protected]>
Tue, 22 Jan 2019 15:26:44 +0000 (08:26 -0700)
commit8b9433eb4de3c26a9226c981c283f9f4896ae030
treed38a0f272d3ca37799f97cd4b63eb4a088747808
parent38197ca176fc259fa4c871d07bcf8389d044a895
direct-io: allow direct writes to empty inodes

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.

Reviewed-by: Jeff Moyer <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Ernesto A. Fernández <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
fs/direct-io.c
This page took 0.05204 seconds and 4 git commands to generate.