Messages in this thread | | | Date | Wed, 9 Aug 2000 01:48:55 +0200 (MET DST) | From | Mikael Pettersson <> | Subject | broken __IS_FLG() <linux/fs.h> in 2.4.0-test6-pre? |
| |
test6-pre2 changed __IS_FLG() in include/linux/fs.h like this:
-#define __IS_FLG(inode,flg) (((inode)->i_sb && (inode)->i_sb->s_flags & (flg)) \ - || (inode)->i_flags & (flg)) +#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
Note that (inode)->i_sb is now unconditionally dereferenced.
Is this a bug or aren't anonymous i_sb-less inodes permitted anymore?
I have a module which exports "objects" to user-space as anonymous files, and the underlying inodes have NULL i_sb fields. This breaks in test6-pre2 and later because mmap(..,MAP_SHARED,..) calls locks_verify_locked(), which in turn evaluates __IS_FLG() [via MANDATORY_LOCK and IS_MANDLOCK]. Since test6-pre2 removed the i_sb NULL test, this causes a NULL pointer dereference.
I can work around this by attaching my inodes to a dummy superblock a la pipefs, but I'd rather not if I can avoid it.
/Mikael
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |