Skip to contentSkip to conversation

: Add dev-id and inode number for debugging in init_special_inode in fs/inode.c

PATCH Manish Katiyar 2 participants 3 messages Mar 31, 2009 – Apr 3, 2009 2 messages not in the archive VFS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 32 lines · Andrew Morton
Quoted 17 lines · On Mon, 23 Mar 2009 08:46:12 +0530 Manish Katiyar <[email protected]> wrote:

Hi Andrew,

Below patch adds device-id and inode number for better debugging.

---
 fs/inode.c |    5 +++--

 1 files changed, 3 insertions(+), 2 deletions(-)
fs/inode.c +0 -0
index 913ab2d..f75e9a4 100644
@@ -1540,7 +1540,8 @@ void init_special_inode(struct inode *inode,
 umode_t mode, dev_t rdev)
       else if (S_ISSOCK(mode))
               inode->i_fop = &bad_sock_fops;
Quoted 8 lines

      else
-             printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o)\n",
-                    mode);
+             printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o) for"
+                               " inode %s:%lu\n", mode, inode->i_sb->s_id,
+                               inode->i_ino);
 }
 EXPORT_SYMBOL(init_special_inode);

I don't think this is really a trivial patch.  Please cc linux-kernel unless the patch is really really trivail.

Quoted 3 lines

The changelog falied to give any reason for making this change.  It should have done so!  I cannot work out the rationale from looking at the code change.

Hi Andrew,
[resending it with updated changelog and ccing linux-kernel]

Below patch adds device-id and inode number for better debugging. This was suggested by Andreas in one of the threads
http://article.gmane.org/gmane.comp.file-systems.ext4/12062 .

---
 fs/inode.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
fs/inode.c +0 -0
index 913ab2d..f75e9a4 100644
@@ -1540,7 +1540,8 @@ void init_special_inode(struct inode *inode,

umode_t mode, dev_t rdev)
else if (S_ISSOCK(mode))
inode->i_fop = &bad_sock_fops;
else
- printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o)\n",
- mode);
+ printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o) for"
+ " inode %s:%lu\n", mode, inode->i_sb->s_id,
+ inode->i_ino);
}
EXPORT_SYMBOL(init_special_inode);

Signature · 8 lines
1.5.4.3



PS: I have also attached the patch, in case it gets word wrapped.

Thanks -
Manish
Quoted 4 lines

From 25d2ddc0336f1f828532475662e114bbd23f478a Mon Sep 17 00:00:00 2001
From: Manish Katiyar <[email protected]>
Date: Mon, 23 Mar 2009 08:08:05 +0530
Subject: [PATCH] Add dev-id and inode number for debugging in init_special_inode

---
 fs/inode.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
fs/inode.c +3 -2
index 913ab2d..f75e9a4 100644
@@ -1540,7 +1540,8 @@ void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
 	else if (S_ISSOCK(mode))
 		inode->i_fop = &bad_sock_fops;
 	else
-		printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o)\n",
-		       mode);
+		printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o) for"
+				  " inode %s:%lu\n", mode, inode->i_sb->s_id,
+				  inode->i_ino);
 }
 EXPORT_SYMBOL(init_special_inode);
Signature · 1 line
1.5.4.3
#3 lore raw

fs/inode.c void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev) · line 1546

Quoted 12 lines · On Tue, 31 Mar 2009 08:11:00 +0530 Manish Katiyar <[email protected]> wrote:
fs/inode.c +3 -2
@@ -1540,7 +1540,8 @@ void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
 	else if (S_ISSOCK(mode))
 		inode->i_fop = &bad_sock_fops;
 	else
-		printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o)\n",
-		       mode);
+		printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o) for"
+				  " inode %s:%lu\n", mode, inode->i_sb->s_id,
+				  inode->i_ino);
 }

Is ther a guarantee that inode->i_sb and inode->i_ino have been initialised at this time?

#4 lore raw
Quoted 4 lines · Andrew Morton

On Tue, 31 Mar 2009 08:11:00 +0530
Manish Katiyar <[email protected]> wrote:

Quoted 15 lines
Quoted 5 lines
fs/inode.c +0 -0
@@ -1540,7 +1540,8 @@ void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
       else if (S_ISSOCK(mode))
               inode->i_fop = &bad_sock_fops;
Quoted 7 lines

      else
-             printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o)\n",
-                    mode);
+             printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o) for"
+                               " inode %s:%lu\n", mode, inode->i_sb->s_id,
+                               inode->i_ino);
 }

Is ther a guarantee that inode->i_sb and inode->i_ino have been initialised at this time?

Hi Andrew,

I checked the code and most of the places we are trying to access inode->i_sb , inode->i_ino before this function call or after this, without any checks. So looks like we will have the values at this point of time.

Thanks -
Manish