Skip to contentSkip to conversation

vfs part 2

GIT PULL Al Viro 2 participants 10 messages Mar 31, 2012

Subsystems (2)
lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

Miklos' first series (with do_lookup() rewrite split into edible
chunks) + assorted bits and pieces.
Please, pull from git:git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for-linus

Shortlog:
Al Viro (18):
selinuxfs: merge dentry allocation into sel_make_dir()
aio: merge aio_cancel_all() with wait_for_all_aios()
aio: take final put_ioctx() into callers of io_destroy()
pstore: trim pstore_get_inode()
mtdchar: kill persistently held vfsmount
get rid of pointless includes of ext2_fs.h
new helper: ext2_image_size()
migrate ext2_fs.h guts to fs/ext2/ext2.h
ext3: move headers to fs/ext3/
untangling do_lookup(), part 1
untangling do_lookup(), part 2
untangling do_lookup(), part 3
untangling do_lookup(), part 4
untangling do_lookup(), part 5
untangling do_lookup(), part 6
untangling do_lookup(), part 7
untangling do_lookup(), part 8
untangling do_lookup(), part 9

J. Bruce Fields (1):
vfs: fix out-of-date dentry_unhash() comment

Miklos Szeredi (4):
vfs: fix d_need_lookup/d_revalidate order in do_lookup
vfs: don't revalidate just looked up dentry
vfs: move MAY_EXEC check from __lookup_hash()
vfs: split __lookup_hash

Thierry Reding (1):
ext2: No longer export ext2_fs.h to user space

Diffstat:

 arch/blackfin/kernel/setup.c              |    7 +-
 drivers/mtd/mtdchar.c                     |   53 +--
 fs/aio.c                                  |   32 +-
 fs/ext2/ext2.h                            |  631 +++++++++++++++++++++++++++++
 fs/ext2/xattr_security.c                  |    5 +-
 fs/ext2/xattr_trusted.c                   |    5 +-
 fs/ext2/xip.c                             |    2 -
 fs/ext3/acl.c                             |    8 +-
 fs/ext3/balloc.c                          |   10 +-
 fs/ext3/bitmap.c                          |    4 +-
 fs/ext3/dir.c                             |    7 +-
 include/linux/ext3_fs.h => fs/ext3/ext3.h |  488 +++++++++++++++++++----
 fs/ext3/ext3_jbd.c                        |    2 +-
 fs/ext3/file.c                            |    6 +-
 fs/ext3/fsync.c                           |    8 +-
 fs/ext3/hash.c                            |    4 +-
 fs/ext3/ialloc.c                          |   13 +-
 fs/ext3/inode.c                           |   12 +-
 fs/ext3/ioctl.c                           |    7 +-
 fs/ext3/namei.c                           |   14 +-
 fs/ext3/resize.c                          |    5 +-
 fs/ext3/super.c                           |   18 +-
 fs/ext3/symlink.c                         |    4 +-
 fs/ext3/xattr.c                           |    7 +-
 fs/ext3/xattr_security.c                  |    6 +-
 fs/ext3/xattr_trusted.c                   |    6 +-
 fs/ext3/xattr_user.c                      |    5 +-
 fs/gfs2/file.c                            |    1 -
 fs/namei.c                                |  195 ++++------
 fs/ocfs2/ioctl.c                          |    2 -
 fs/pstore/inode.c                         |   26 +-
 include/linux/Kbuild                      |    1 -
 include/linux/ext2_fs.h                   |  569 +-------------------------
 include/linux/ext2_fs_sb.h                |  126 ------
 include/linux/ext3_fs_i.h                 |  151 -------
 include/linux/ext3_fs_sb.h                |   91 -----
 include/linux/ext3_jbd.h                  |  229 -----------
 init/do_mounts_initrd.c                   |    1 -
 init/do_mounts_rd.c                       |    9 +-
 security/selinux/hooks.c                  |    9 +-
 security/selinux/selinuxfs.c              |  108 ++---
 41 files changed, 1248 insertions(+), 1639 deletions(-)
 rename include/linux/ext3_fs.h => fs/ext3/ext3.h (67%)
 delete mode 100644 include/linux/ext2_fs_sb.h
 delete mode 100644 include/linux/ext3_fs_i.h
 delete mode 100644 include/linux/ext3_fs_sb.h
 delete mode 100644 include/linux/ext3_jbd.h
#1 lore raw
Quoted 2 lines · Al Viro

       Miklos' first series (with do_lookup() rewrite split into edible chunks) + assorted bits and pieces.

Hmm. This oopses at boot in d_alloc() (or similar) for me. It's in some initcall, very early, before user space has even started.

It may be some other change than your pull... I will explore more, but I thought I'd let you know that it's the prime suspect right now.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 3 lines · Linus Torvalds

It may be some other change than your pull... I will explore more, but I thought I'd let you know that it's the prime suspect right now.

Verified. My tree just before the pull works fine (current tip plus a couple of my pending selinux avc optimizations). So it's your pull.

Linus

author maintainer
#3 lore raw
Quoted 8 lines · Linus Torvalds
Quoted 3 lines · Linus Torvalds

It may be some other change than your pull... I will explore more, but I thought I'd let you know that it's the prime suspect right now.

Verified. My tree just before the pull works fine (current tip plus a couple of my pending selinux avc optimizations). So it's your pull.

Works here... OK, that makes selinuxfs one the most likely suspect; let me check if I can reproduce any crap with that... Do you see anything selinux-related in the call chain, BTW?

#4 lore raw
Quoted 4 lines · Al Viro

Works here...  OK, that makes selinuxfs one the most likely suspect; let me check if I can reproduce any crap with that...  Do you see anything selinux-related in the call chain, BTW?

Yup.The oops scrolled off my screen, but the call chain was:

init_sel_fs -> kernel_mount_data -> vfs_kern_mount -> mount_fs ->
sel_mount -> mount_single -> (scrolled off)

and then the actual oops happens in d_alloc+0x17, which is "parent->d_sb", so parent was NULL or something (the register state also scrolled off, and I didn't check the fault address, so it could have been some other invalid pointer too).

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#5 lore raw
Quoted 8 lines · Linus Torvalds
Quoted 4 lines · Al Viro

Works here... ?OK, that makes selinuxfs one the most likely suspect; let me check if I can reproduce any crap with that... ?Do you see anything selinux-related in the call chain, BTW?

Yup.The oops scrolled off my screen, but the call chain was:

Quoted 7 lines

init_sel_fs -> kernel_mount_data -> vfs_kern_mount -> mount_fs ->
sel_mount -> mount_single -> (scrolled off)

and then the actual oops happens in d_alloc+0x17, which is "parent->d_sb", so parent was NULL or something (the register state also scrolled off, and I didn't check the fault address, so it could have been some other invalid pointer too).

Sigh... sel_make_dir(), last line. Should be return dentry, is return 0... Fixes the problem here (I've managed to reproduce it).

The question is, what to do with it? The fix is obvious and the damn thing seems to work with it just fine. OTOH, the testing it got had been obviously worthless (should've set default to selinux).

Variants:
1) drop that commit, fold obvious fix into it, leave it for for-next
once -rc1 is there; ask you to pull the branch with that sucker excluded
2) fold the fix into commit, ask you to pull the resulting branch
3) add fix to the end of existing branch, ask to pull

author maintainer
#6 lore raw
Quoted 12 lines · Al Viro
Quoted 11 lines · Linus Torvalds
Quoted 4 lines · Al Viro

Works here... ?OK, that makes selinuxfs one the most likely suspect; let me check if I can reproduce any crap with that... ?Do you see anything selinux-related in the call chain, BTW?

Yup.The oops scrolled off my screen, but the call chain was:

init_sel_fs -> kernel_mount_data -> vfs_kern_mount -> mount_fs ->
sel_mount -> mount_single -> (scrolled off)

Quoted 7 lines
Quoted 4 lines

and then the actual oops happens in d_alloc+0x17, which is "parent->d_sb", so parent was NULL or something (the register state also scrolled off, and I didn't check the fault address, so it could have been some other invalid pointer too).

Sigh... sel_make_dir(), last line. Should be return dentry, is return 0... Fixes the problem here (I've managed to reproduce it).

IOW, the incremental is

security/selinux/selinuxfs.c +1 -1
index 364b784..d7018bf 100644
@@ -1804,7 +1804,7 @@ static struct dentry *sel_make_dir(struct dentry *dir, const char *name,
 	/* bump link count on parent directory, too */
 	inc_nlink(dir->d_inode);
 
-	return 0;
+	return dentry;
 }
 
 static int sel_fill_super(struct super_block *sb, void *data, int silent)
#7 lore raw
In reply to Al Viro
Quoted 6 lines · Al Viro

Variants:
       1) drop that commit, fold obvious fix into it, leave it for for-next once -rc1 is there; ask you to pull the branch with that sucker excluded
       2) fold the fix into commit, ask you to pull the resulting branch
       3) add fix to the end of existing branch, ask to pull

Let's go for (2). I'll take a new look after the pull request, but no guarantees that I'll then pull it.

Btw, I liked the do_lookup cleanups, but nicer commit logs would have been good. Especially the first lines. The whole

untangling do_lookup(), part 1
untangling do_lookup(), part 2
untangling do_lookup(), part 3
untangling do_lookup(), part 4
untangling do_lookup(), part 5
untangling do_lookup(), part 6
untangling do_lookup(), part 7
untangling do_lookup(), part 8
untangling do_lookup(), part 9

in shortlogs (and gitk!) does turn me off. So since you have to redo the series anyway, can I ask you to perhaps try to make it a bit more descriptive?

Linus

author maintainer
#8 lore raw
Quoted 24 lines · Linus Torvalds
Quoted 6 lines · Al Viro

Variants:
? ? ? ?1) drop that commit, fold obvious fix into it, leave it for for-next once -rc1 is there; ask you to pull the branch with that sucker excluded ? ? ? ?2) fold the fix into commit, ask you to pull the resulting branch ? ? ? ?3) add fix to the end of existing branch, ask to pull

Let's go for (2). I'll take a new look after the pull request, but no guarantees that I'll then pull it.

Btw, I liked the do_lookup cleanups, but nicer commit logs would have been good. Especially the first lines. The whole

untangling do_lookup(), part 1
untangling do_lookup(), part 2
untangling do_lookup(), part 3
untangling do_lookup(), part 4
untangling do_lookup(), part 5
untangling do_lookup(), part 6
untangling do_lookup(), part 7
untangling do_lookup(), part 8
untangling do_lookup(), part 9

Quoted 3 lines

in shortlogs (and gitk!) does turn me off. So since you have to redo the series anyway, can I ask you to perhaps try to make it a bit more descriptive?

OK... Keep in mind that this is a splitup of what used to be a monolithic patch from Miklos, so this series is basically "how do I convince myself that his patch is correct (or find a hole in it)". No holes found and I like the resulting cleanup, so in it went...

Anyway, commit messages prettied up a bit, fix folded and the whole thing is pushed to the same place - i.e.

git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for-linus

Shortlog:
Al Viro (18):
selinuxfs: merge dentry allocation into sel_make_dir()
aio: merge aio_cancel_all() with wait_for_all_aios()
aio: take final put_ioctx() into callers of io_destroy()
pstore: trim pstore_get_inode()
mtdchar: kill persistently held vfsmount
get rid of pointless includes of ext2_fs.h
new helper: ext2_image_size()
migrate ext2_fs.h guts to fs/ext2/ext2.h
ext3: move headers to fs/ext3/
untangling do_lookup() - isolate !dentry stuff from the rest of it. untangling do_lookup() - expand the area under ->i_mutex untangling do_lookup() - eliminate a loop.
untangling do_lookup() - get rid of need_reval in !dentry case untangling do_lookup() - massage !dentry case towards __lookup_hash() untangling do_lookup() - merge failure exits in !dentry case untangling do_lookup() - merge d_alloc_and_lookup() callers untangling do_lookup() - switch to calling __lookup_hash() untangling do_lookup() - take __lookup_hash()-calling case out of line.

J. Bruce Fields (1):
vfs: fix out-of-date dentry_unhash() comment

Miklos Szeredi (4):
vfs: fix d_need_lookup/d_revalidate order in do_lookup
vfs: don't revalidate just looked up dentry
vfs: move MAY_EXEC check from __lookup_hash()
vfs: split __lookup_hash

Thierry Reding (1):
ext2: No longer export ext2_fs.h to user space

Diffstat:

 arch/blackfin/kernel/setup.c              |    7 +-
 drivers/mtd/mtdchar.c                     |   53 +--
 fs/aio.c                                  |   32 +-
 fs/ext2/ext2.h                            |  631 +++++++++++++++++++++++++++++
 fs/ext2/xattr_security.c                  |    5 +-
 fs/ext2/xattr_trusted.c                   |    5 +-
 fs/ext2/xip.c                             |    2 -
 fs/ext3/acl.c                             |    8 +-
 fs/ext3/balloc.c                          |   10 +-
 fs/ext3/bitmap.c                          |    4 +-
 fs/ext3/dir.c                             |    7 +-
 include/linux/ext3_fs.h => fs/ext3/ext3.h |  488 +++++++++++++++++++----
 fs/ext3/ext3_jbd.c                        |    2 +-
 fs/ext3/file.c                            |    6 +-
 fs/ext3/fsync.c                           |    8 +-
 fs/ext3/hash.c                            |    4 +-
 fs/ext3/ialloc.c                          |   13 +-
 fs/ext3/inode.c                           |   12 +-
 fs/ext3/ioctl.c                           |    7 +-
 fs/ext3/namei.c                           |   14 +-
 fs/ext3/resize.c                          |    5 +-
 fs/ext3/super.c                           |   18 +-
 fs/ext3/symlink.c                         |    4 +-
 fs/ext3/xattr.c                           |    7 +-
 fs/ext3/xattr_security.c                  |    6 +-
 fs/ext3/xattr_trusted.c                   |    6 +-
 fs/ext3/xattr_user.c                      |    5 +-
 fs/gfs2/file.c                            |    1 -
 fs/namei.c                                |  195 ++++------
 fs/ocfs2/ioctl.c                          |    2 -
 fs/pstore/inode.c                         |   26 +-
 include/linux/Kbuild                      |    1 -
 include/linux/ext2_fs.h                   |  569 +-------------------------
 include/linux/ext2_fs_sb.h                |  126 ------
 include/linux/ext3_fs_i.h                 |  151 -------
 include/linux/ext3_fs_sb.h                |   91 -----
 include/linux/ext3_jbd.h                  |  229 -----------
 init/do_mounts_initrd.c                   |    1 -
 init/do_mounts_rd.c                       |    9 +-
 security/selinux/hooks.c                  |    9 +-
 security/selinux/selinuxfs.c              |  110 ++---
 41 files changed, 1249 insertions(+), 1640 deletions(-)
 rename include/linux/ext3_fs.h => fs/ext3/ext3.h (67%)
 delete mode 100644 include/linux/ext2_fs_sb.h
 delete mode 100644 include/linux/ext3_fs_i.h
 delete mode 100644 include/linux/ext3_fs_sb.h
 delete mode 100644 include/linux/ext3_jbd.h
#9 lore raw
Quoted 3 lines · Al Viro

Anyway, commit messages prettied up a bit, fix folded and the whole thing is pushed to the same place - i.e.

Ok, looks good, works for me.

Pulled and pushed out,

Linus