From: Blaisorblade <blaisorblade@yahoo.it>
To: LKML <linux-kernel@vger.kernel.org>,
"Greg Kroah-Hartman" <greg@kroah.com>
Subject: 2.6.14.3 - sysfs duplicated dentry bug
Date: Fri, 9 Dec 2005 18:48:41 +0100 [thread overview]
Message-ID: <200512091848.42297.blaisorblade@yahoo.it> (raw)
[-- Attachment #1: Type: text/plain, Size: 4281 bytes --]
Q: Since when is a directory entry allowed to be duplicate?
A: Since Linux 2.6.14!
$ uname -r
2.6.14.3-bs2-mroute
The only sysfs-related change is the use of a custom DSDT, which is new to
this kernel.
$ ls -li /sys/devices/system/
totale 0
425 drwxr-xr-x 3 root root 0 7 dic 03:57 acpi
17 drwxr-xr-x 3 root root 0 7 dic 03:57 cpu
197 drwxr-xr-x 3 root root 0 7 dic 03:57 i8237
195 drwxr-xr-x 3 root root 0 7 dic 03:57 i8259
204 drwxr-xr-x 3 root root 0 7 dic 03:57 ioapic
242 drwxr-xr-x 3 root root 0 7 dic 03:57 irqrouter
202 drwxr-xr-x 3 root root 0 7 dic 03:57 lapic
421 drwxr-xr-x 3 root root 0 7 dic 03:57 lapic_nmi
199 drwxr-xr-x 3 root root 0 7 dic 03:57 machinecheck
193 drwxr-xr-x 3 root root 0 7 dic 03:57 timer
193 drwxr-xr-x 3 root root 0 7 dic 03:57 timer
$ ls -li /sys/devices/system/ -d
16 drwxr-xr-x 12 root root 0 7 dic 03:57 /sys/devices/system/
From the hard link count you can also verify (tested with find -noleaf, output
below) that
the duplicate "timer" dentry is not counted again in the hard link count.
(perfectly reproducible, it's not a race condition on "ls" time - and it
duplicates always the same dentry. I've not tested rebooting though).
lsmod output and .config attached. Additionally, "strace -v" output attached
(SysfsRootBugreport.bz2) - the relevant line is the getdents call
on /sys/devices/system:
getdents(3, {{d_ino=16, d_off=1, d_reclen=24, d_name="."} {d_ino=7, d_off=2,
d_reclen=24, d_name=".."} {d_ino=425, d_off=3, d_reclen=24, d_name="acpi"}
{d_ino=421, d_off=4, d_reclen=32, d_name="lapic_nmi"} {d_ino=242, d_off=5,
d_reclen=32, d_name="irqrouter"} {d_ino=204, d_off=6, d_reclen=32,
d_name="ioapic"} {d_ino=202, d_off=7, d_reclen=32, d_name="lapic"}
{d_ino=199, d_off=8, d_reclen=32, d_name="machinecheck"} {d_ino=197, d_off=9,
d_reclen=32, d_name="i8237"} {d_ino=195, d_off=10, d_reclen=32,
d_name="i8259"}
/*The dentry*/
{d_ino=193, d_off=11, d_reclen=32, d_name="timer"}
/*Again*/
{d_ino=193, d_off=12, d_reclen=32, d_name="timer"}
{d_ino=17, d_off=13, d_reclen=24, d_name="cpu"}}, 4096) = 384
I have not tested if this bug is new to this kernel.
Finally:
# find /sys/devices/system/ -noleaf
/sys/devices/system/
/sys/devices/system/acpi
/sys/devices/system/acpi/acpi0
/sys/devices/system/lapic_nmi
/sys/devices/system/lapic_nmi/lapic_nmi0
/sys/devices/system/irqrouter
/sys/devices/system/irqrouter/irqrouter0
/sys/devices/system/ioapic
/sys/devices/system/ioapic/ioapic0
/sys/devices/system/lapic
/sys/devices/system/lapic/lapic0
/sys/devices/system/machinecheck
/sys/devices/system/machinecheck/machinecheck0
/sys/devices/system/machinecheck/machinecheck0/check_interval
/sys/devices/system/machinecheck/machinecheck0/tolerant
/sys/devices/system/machinecheck/machinecheck0/bank4ctl
/sys/devices/system/machinecheck/machinecheck0/bank3ctl
/sys/devices/system/machinecheck/machinecheck0/bank2ctl
/sys/devices/system/machinecheck/machinecheck0/bank1ctl
/sys/devices/system/machinecheck/machinecheck0/bank0ctl
/sys/devices/system/i8237
/sys/devices/system/i8237/i82370
/sys/devices/system/i8259
/sys/devices/system/i8259/i82590
/sys/devices/system/timer
/sys/devices/system/timer
/sys/devices/system/cpu
/sys/devices/system/cpu/cpu0
/sys/devices/system/cpu/cpu0/cpufreq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu0/cpufreq/affected_cpus
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
(and -noleaf is indeed needed, because otherwise find does not recurse inbto
cpu0/)
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
[-- Attachment #2: lsmod --]
[-- Type: text/plain, Size: 2175 bytes --]
Module Size Used by
sd_mod 18200 0
cifs 221852 1
nls_iso8859_1 5504 0
nls_cp437 7232 0
isofs 37964 0
zlib_inflate 17728 1 isofs
cpufreq_powersave 2176 0
af_packet 25100 2
cpufreq_ondemand 7532 1
ipt_REJECT 5888 2
ipt_LOG 7168 1
ipt_length 2048 2
ipt_state 2304 5
iptable_filter 3584 1
ipt_MASQUERADE 4032 3
iptable_nat 9028 1
ip_nat 21628 2 ipt_MASQUERADE,iptable_nat
ip_conntrack 56080 4 ipt_state,ipt_MASQUERADE,iptable_nat,ip_nat
ipt_TOS 2816 6
ipt_MARK 3008 2
ipt_multiport 2944 6
iptable_mangle 3392 1
ip_tables 22784 11 ipt_REJECT,ipt_LOG,ipt_length,ipt_state,iptable_filter,ipt_MASQUERADE,iptable_nat,ipt_TOS,ipt_MARK,ipt_multiport,iptable_mangle
uhci_hcd 34208 0
parport_pc 38440 0
parport 42252 1 parport_pc
yenta_socket 27724 0
rsrc_nonstatic 13312 1 yenta_socket
pcmcia_core 45212 2 yenta_socket,rsrc_nonstatic
i810_audio 39320 0
ac97_codec 21720 1 i810_audio
ehci_hcd 34056 0
usb_storage 46916 0
scsi_mod 113328 2 sd_mod,usb_storage
ohci_hcd 22532 0
snd_pcm_oss 55904 0
snd_mixer_oss 19008 1 snd_pcm_oss
snd_seq_oss 36224 0
snd_seq_midi_event 8704 1 snd_seq_oss
snd_seq 59776 4 snd_seq_oss,snd_seq_midi_event
snd_seq_device 9808 2 snd_seq_oss,snd_seq
snd_intel8x0 37472 5
snd_ac97_codec 107416 1 snd_intel8x0
snd_ac97_bus 2880 1 snd_ac97_codec
snd_pcm 102796 5 snd_pcm_oss,snd_intel8x0,snd_ac97_codec
snd_timer 27400 4 snd_seq,snd_pcm
snd_page_alloc 11984 2 snd_intel8x0,snd_pcm
nls_iso8859_15 6144 2
nls_cp850 6400 1
vfat 15296 1
fat 55472 1 vfat
[-- Attachment #3: config-2.6.14.3-bs2-mroute.bz2 --]
[-- Type: application/x-bzip2, Size: 7311 bytes --]
[-- Attachment #4: SysfsRootBugReport.bz2 --]
[-- Type: application/x-bzip2, Size: 4628 bytes --]
next reply other threads:[~2005-12-09 17:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-09 17:48 Blaisorblade [this message]
2005-12-09 17:55 ` Greg KH
2005-12-23 22:25 ` Blaisorblade
2005-12-23 22:44 ` Greg KH
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=200512091848.42297.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=greg@kroah.com \
--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
Powered by JetHome