Files
Ryusuke Konishi b88b724607 nilfs2: fix kernel oops in error case of nilfs_ioctl_move_blocks
commit 5399dd1fc8f5e812db931225ef5f67d89f3b1a56 upstream.

This fixes a kernel oops reported by Markus Trippelsdorf in the email
titled "[NILFS users] kernel Oops while running nilfs_cleanerd".

The oops was caused by a bug of error path in
nilfs_ioctl_move_blocks() function, which was inlined in
nilfs_ioctl_clean_segments().

nilfs_ioctl_move_blocks checks duplication of blocks which will be
moved in garbage collection.  But, the check should have be done
within nilfs_ioctl_move_inode_block() to prevent list corruption among
buffers storing the target blocks.

To fix the kernel oops, this moves forward the duplication check
before the list insertion.

I also tested this for stable trees [2.6.30, 2.6.31].

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-08 10:20:50 -08:00
..
2009-04-07 08:31:13 -07:00
2009-04-07 08:31:13 -07:00
2009-07-12 12:22:34 -07:00
2009-04-07 08:31:19 -07:00
2009-04-07 08:31:14 -07:00
2009-04-07 08:31:14 -07:00
2009-06-24 08:17:05 -04:00
2009-07-14 12:34:17 +09:00
2009-04-07 08:31:16 -07:00
2009-04-07 08:31:13 -07:00
2009-06-24 08:17:05 -04:00
2009-04-07 08:31:13 -07:00
2009-06-11 21:36:18 -04:00