lkml.org 
[lkml]   [2000]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectbroken __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/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:1.320 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site