ext4: don't release page refs in ext4_end_bio()
commitb43d17f319f2c502b17139d1cf70731b2b62c644
authorCurt Wohlgemuth <curtw@google.com>
Mon, 5 Mar 2012 15:40:15 +0000 (5 10:40 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 5 Mar 2012 15:40:15 +0000 (5 10:40 -0500)
tree05215b2155e4dbc66f6b1035b8afba7c805284db
parent491caa43639abcffaa645fbab372a7ef4ce2975c
ext4: don't release page refs in ext4_end_bio()

We can clear PageWriteback on each page when the IO
completes, but we can't release the references on the page
until we convert any uninitialized extents.

Without this patch, the use of the dioread_nolock mount
option can break buffered writes, because extents may
not be converted by the time a subsequent buffered read
comes in; if the page is not in the page cache, a read
will return zeros if the extent is still uninitialized.

I tested this with a (temporary) patch that adds a call
to msleep(1000) at the start of ext4_end_io_work(), to delay
processing of each DIO-unwritten work queue item.  With this
msleep(), a simple workload of

  fallocate
  write
  fadvise
  read

will fail without this patch, succeeds with it.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/page-io.c