]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ext3: disable O_DIRECT in journalled-data mode
authorAndrew Morton <akpm@digeo.com>
Wed, 18 Jun 2003 01:33:17 +0000 (18:33 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Wed, 18 Jun 2003 01:33:17 +0000 (18:33 -0700)
We cannot sensibly support O_DIRECT reads or writes when all writes are
journalled.

This is because the VFS explicitly avoids syncing the file metadata during
O_DIRECT reads and writes.  ext3 with journalled data will leave pending
changes in memory and they will overwrite the results of O_DIRECT writes, and
O_DIRECT reads will not return the latest data.

Setting the a_op to null will cause opens and fcntl(F_SETFL) to return
-EINVAL if O_DIRECT is requested.

fs/ext3/inode.c

index 3c61bec550915f82909d88f39193484eba1b9098..277f940cc0025cce288eb02ef998e6d8caeefd69 100644 (file)
@@ -1644,7 +1644,6 @@ static struct address_space_operations ext3_journalled_aops = {
        .bmap           = ext3_bmap,
        .invalidatepage = ext3_invalidatepage,
        .releasepage    = ext3_releasepage,
-       .direct_IO      = ext3_direct_IO,
 };
 
 void ext3_set_aops(struct inode *inode)