Skip to contentSkip to conversation

bisected:fs:anon_inodes.c one processor core reads full throttle.

PATCH In review Justin P. Mattock 2 participants 3 messages May 25, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bisected:fs:anon_inodes.c one processor core reads full throttle.

I have no idea why this is doing this., but when doing watch cat /proc/cpuinfo I see one of my cores reading full throttle.

The bisect results are this:

a7cf4145bb86aaf85d4d4d29a69b50b688e2e49d is the first bad commit commit a7cf4145bb86aaf85d4d4d29a69b50b688e2e49d

Author: Eric Paris <[email protected]>
Date:   Fri May 14 11:44:10 2010 -0400

anon_inode: set S_IFREG on the anon_inode

anon_inode_mkinode() sets inode->i_mode = S_IRUSR | S_IWUSR; This means that (inode->i_mode & S_IFMT) == 0. This trips up some SELinux code that needs to determine if a given inode is a regular file, a directory, etc. The easiest solution is to just make sure that the anon_inode also sets S_IFREG.

doing a git revert a7cf4145 gets cpuinfo to show both cores running as they should.(both iMac, and macbookpro hit this).

I looked at the manual for fstat, and am not understanding how S_IFREG(standard file) can cause such and issue. Below(after reading the man), was the only other option I can make out(other than FIFO)to use to fix this issue.

either using S_IFMT is a good solution, or it's not (I'm not sure at the moment),let me know.

---
 fs/anon_inodes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/anon_inodes.c +1 -1
index 9bd4b38..8ac1693 100644
@@ -205,7 +205,7 @@ static struct inode *anon_inode_mkinode(void)
 	 * that it already _is_ on the dirty list.
 	 */
 	inode->i_state = I_DIRTY;
-	inode->i_mode = S_IFREG | S_IRUSR | S_IWUSR;
+	inode->i_mode = S_IFMT | S_IRUSR | S_IWUSR;
 	inode->i_uid = current_fsuid();
 	inode->i_gid = current_fsgid();
 	inode->i_flags |= S_PRIVATE;
Signature · 1 line
1.6.5.GIT
#2 lore raw
Quoted 6 lines · Eric Paris
Quoted 4 lines · Justin P. Mattock

I have no idea why this is doing this., but when doing watch cat /proc/cpuinfo I see one of my cores reading full throttle.

Quoted 11 lines

Check out:
http://lkml.org/lkml/2010/5/22/150
and
http://lkml.org/lkml/2010/5/25/159

Sorry, but this patch isn't right (S_IFMNT shouldn't be used like that)

-Eric

ahh.. so udev is getting crapped out..
alright I'll revert this for now..

Justin P. Mattock