linux/fs/nilfs2
Ryusuke Konishi af4e36318e nilfs2: fix list corruption after ifile creation failure
If nilfs_attach_checkpoint() gets a memory allocation failure during
creation of ifile, it will return without removing nilfs_sb_info
struct from ns_supers list.  When a concurrently mounted snapshot is
unmounted or another new snapshot is mounted after that, this causes
kernel oops as below:

> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: [<f83662ff>] nilfs_find_sbinfo+0x74/0xa4 [nilfs2]
> *pde = 00000000
> Oops: 0000 [#1] SMP
<snip>
> Call Trace:
>  [<f835dc29>] ? nilfs_get_sb+0x165/0x532 [nilfs2]
>  [<c1173c87>] ? ida_get_new_above+0x16d/0x187
>  [<c109a7f8>] ? alloc_vfsmnt+0x7e/0x10a
>  [<c1070790>] ? kstrdup+0x2c/0x40
>  [<c1089041>] ? vfs_kern_mount+0x96/0x14e
>  [<c108913d>] ? do_kern_mount+0x32/0xbd
>  [<c109b331>] ? do_mount+0x642/0x6a1
>  [<c101a415>] ? do_page_fault+0x0/0x2d1
>  [<c1099c00>] ? copy_mount_options+0x80/0xe2
>  [<c10705d8>] ? strndup_user+0x48/0x67
>  [<c109b3f1>] ? sys_mount+0x61/0x90
>  [<c10027cc>] ? sysenter_do_call+0x12/0x22

This fixes the problem.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: stable@kernel.org
2010-08-16 11:08:36 +09:00
..
Kconfig Revert "task_struct: make journal_info conditional" 2009-12-17 13:23:24 -08:00
Makefile nilfs2: update makefile and Kconfig 2009-04-07 08:31:16 -07:00
alloc.c nilfs2: add kernel doc comments to persistent object allocator functions 2010-05-10 11:32:31 +09:00
alloc.h nilfs2: add kernel doc comments to persistent object allocator functions 2010-05-10 11:32:31 +09:00
bmap.c nilfs2: get rid of nilfs_bmap_union 2010-07-23 10:02:14 +09:00
bmap.h nilfs2: get maximum number of child nodes from bmap object 2010-07-23 10:02:14 +09:00
btnode.c nilfs2: add read ahead mode to nilfs_btnode_submit_block 2010-07-23 10:02:15 +09:00
btnode.h nilfs2: add read ahead mode to nilfs_btnode_submit_block 2010-07-23 10:02:15 +09:00
btree.c nilfs2: apply read-ahead for nilfs_btree_lookup_contig 2010-07-23 10:02:16 +09:00
btree.h nilfs2: get rid of nilfs_bmap_union 2010-07-23 10:02:14 +09:00
cpfile.c nilfs2: trivial coding style fix 2009-12-25 13:01:50 +09:00
cpfile.h nilfs2: separate read method of meta data files on super root block 2009-11-20 10:05:48 +09:00
dat.c nilfs2: fix various typos in comments 2010-03-14 10:29:51 +09:00
dat.h nilfs2: separate read method of meta data files on super root block 2009-11-20 10:05:48 +09:00
dir.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-08-10 11:26:52 -07:00
direct.c nilfs2: remove redundant pointer checks in bmap lookup functions 2010-07-23 10:02:14 +09:00
direct.h nilfs2: get rid of nilfs_bmap_union 2010-07-23 10:02:14 +09:00
file.c drop unused dentry argument to ->fsync 2010-05-27 22:05:02 -04:00
gcdat.c simplify checks for I_CLEAR/I_FREEING 2010-08-09 16:47:44 -04:00
gcinode.c nilfs2: add read ahead mode to nilfs_btnode_submit_block 2010-07-23 10:02:15 +09:00
ifile.c nilfs2: add palloc cache to ifile 2009-11-20 10:05:50 +09:00
ifile.h nilfs2: separate constructor of metadata files 2009-11-20 10:05:48 +09:00
inode.c convert nilfs2 to ->evict_inode() 2010-08-09 16:48:25 -04:00
ioctl.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2 2010-04-12 18:34:25 -07:00
mdt.c nilfs2: get rid of nilfs_bmap_union 2010-07-23 10:02:14 +09:00
mdt.h nilfs2: add cache framework for persistent object allocator 2009-11-20 10:05:50 +09:00
namei.c nilfs really shouldn't slap struct dentry on stack... 2010-03-03 14:07:58 -05:00
nilfs.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-08-10 11:26:52 -07:00
page.c nilfs2: introduce check flag to btree node buffer 2010-07-23 10:02:15 +09:00
page.h nilfs2: introduce check flag to btree node buffer 2010-07-23 10:02:15 +09:00
recovery.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-08-10 11:26:52 -07:00
sb.h nilfs2: simplify remaining sget() use 2009-06-11 21:36:18 -04:00
segbuf.c block: unify flags for struct bio and struct request 2010-08-07 18:20:39 +02:00
segbuf.h nilfs2: get rid of macros for segment summary information 2010-07-23 10:02:09 +09:00
segment.c nilfs2: do not update log cursor for small change 2010-07-23 10:02:11 +09:00
segment.h nilfs2: rename nilfs_recover_logical_segments function 2010-07-23 10:02:09 +09:00
sufile.c nilfs2: fix various typos in comments 2010-03-14 10:29:51 +09:00
sufile.h nilfs2: clean up get/put function of a segment usage 2009-11-20 10:05:51 +09:00
super.c nilfs2: fix list corruption after ifile creation failure 2010-08-16 11:08:36 +09:00
the_nilfs.c nilfs2: reject filesystem with unsupported block size 2010-07-25 23:29:21 +09:00
the_nilfs.h nilfs2: do not update log cursor for small change 2010-07-23 10:02:11 +09:00