]> git.hungrycats.org Git - linux/commit
[PATCH] ramfs o_sync oops fix
authorAndrew Morton <akpm@osdl.org>
Thu, 3 Jun 2004 00:57:52 +0000 (17:57 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 3 Jun 2004 00:57:52 +0000 (17:57 -0700)
commit97e012bbf087abb5dff904aa042eb0a3e5e0bd08
treefcd4646b51314a8beb9d44982722407981760aed
parenta0f562dfdc13a7108069013566dc9545af713b31
[PATCH] ramfs o_sync oops fix

Writing to ramfs files with O_SYNC dereferences null in mpage_writepages(),
due to null a_ops->writepage.  The call path is

generic_file_aio_write_nolock
->generic_osync_inode
  ->write_inode_now
    ->__writeback_single_inode
      ->__sync_single_inode
        ->do_writepages
          ->mpage_writepages

The best fix for this is to visit all ram-backed filesystems and give them a
no-op a_ops.writepages.  But baling out if the file is memory-backed is a
sufficient coverall and is how we handle this in __filemap_fdatawrite().

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/fs-writeback.c