[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>
Showing
Please register or sign in to comment