mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Iustin Pop <iusty@k1024.org>
To: linux-kernel@vger.kernel.org
Subject: inode->i_rdev not initialized in 2.4 fs/inode.c, only in 2.6?
Date: Tue, 28 Oct 2003 01:45:14 +0200	[thread overview]
Message-ID: <20031027234514.GA11213@saytrin.hq.k1024.org> (raw)

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.

             reply	other threads:[~2003-10-27 23:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-27 23:45 Iustin Pop [this message]
2003-10-28  0:20 ` viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031027234514.GA11213@saytrin.hq.k1024.org \
    --to=iusty@k1024.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®