mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* inode->i_rdev not initialized in 2.4 fs/inode.c, only in 2.6?
@ 2003-10-27 23:45 Iustin Pop
  2003-10-28  0:20 ` viro
  0 siblings, 1 reply; 2+ messages in thread
From: Iustin Pop @ 2003-10-27 23:45 UTC (permalink / raw)
  To: linux-kernel

Hello,

I'm running 2.4.22 (with XFS and skas patch), but these patches do not
affect the code in question. /proc/version = Linux version 2.4.22-xfs
(root@saytrin) (gcc version 3.3.2 20030908 (Debian prerelease))

I get strange results (st.st_rdev != 0) in userspace after stat on some
non-devices regular file/directory. On one computer, /etc gives 773 and
/etc/init.d 0, while on another /etc gives 0 and /etc/init.d 13478.

After gdb and seeing it comes from kernel, I looked around and saw that
in fs/inode.c, i_rdev is not zeroed. Nor does it *seem* that
kmem_cache_alloc clears the memory, but I could be mistaken, it's
complicated code (I think it only clears at cache creation). And r_dev
is what gets transformed into st_rdev in fs/stat.c

2.6 fixes this behavior, by saying "inode->i_rdev = to_kdev_t(0);".
Shouldn't this be also in 2.4?

Thanks,
Iustin Pop

Please CC me as I'm not on the list.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-28  0:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-27 23:45 inode->i_rdev not initialized in 2.4 fs/inode.c, only in 2.6? Iustin Pop
2003-10-28  0:20 ` viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®