Once the blockdev inode for /dev/ram0 is dirtied we have a memory-backed inode on the blockdev superblock's s_dirty list. sync_sb_inodes() sees the memory-backed inode on the superblock and assumes that all the other inodes on the superblock are also memory-backed. This is not true for the blockdev superblock! We forget to write out dirty pages against the following blockdevs. Fix this by just leaving the inode dirty and moving on to inspect the other blockdev inodes on sb->s_io. (This is a little inefficient: an alternative is to leave dirtied memory-backed inodes on inode_in_use, so nobody ever even considers them for writeout. But that introduces an inconsistency and is a bit kludgey). fs/fs-writeback.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletion(-) diff -puN fs/fs-writeback.c~writeback-memory-backed-fix fs/fs-writeback.c --- 25/fs/fs-writeback.c~writeback-memory-backed-fix 2003-06-13 00:56:20.000000000 -0700 +++ 25-akpm/fs/fs-writeback.c 2003-06-13 01:02:35.000000000 -0700 @@ -260,8 +260,21 @@ sync_sb_inodes(struct super_block *sb, s struct address_space *mapping = inode->i_mapping; struct backing_dev_info *bdi = mapping->backing_dev_info; - if (bdi->memory_backed) + if (bdi->memory_backed) { + if (sb == blockdev_superblock) { + /* + * Dirty memory-backed blockdev: the ramdisk + * driver does this. + */ + list_move(&inode->i_list, &sb->s_dirty); + continue; + } + /* + * Assume that all inodes on this superblock are memory + * backed. Skip the superblock. + */ break; + } if (wbc->nonblocking && bdi_write_congested(bdi)) { wbc->encountered_congestion = 1; _