From: Padraig Brady <padraig@antefacto.com>
To: unlisted-recipients:; (no To-header on input)@localhost.localdomain
Cc: Owen Taylor <otaylor@redhat.com>,
andersen@codepoet.org,
Linux-Kernel mailing list <linux-kernel@vger.kernel.org>,
Martin Dalecki <dalecki@evision-ventures.com>
Subject: Re: Need help tracing regular write activity in 5 s interval
Date: Wed, 05 Jun 2002 23:22:09 +0100 [thread overview]
Message-ID: <3CFE8F11.8060304@antefacto.com> (raw)
In-Reply-To: <20020602135501.GA2548@merlin.emma.line.org> <3CFCA2B0.4060501@antefacto.com> <20020604120434.GA1386@codepoet.org> <3CFE1B78.9010406@antefacto.com> <20020605155017.251EC2423B5@fresnel.labs.redhat.com> <3CFE3FCB.9040109@antefacto.com>
[-- Attachment #1: Type: text/plain, Size: 984 bytes --]
Padraig Brady wrote:
> Owen Taylor wrote:
>
>> Padraig Brady <padraig@antefacto.com> writes:
>>
>>> I'm sure it will :-)
>>>
>>> However this it just masking the "problem"
>>
>>
>> Well, the question is, "what is the problem"?
>> Your problem is that a debug message is being output by the kernel and
>> filling your logs. If the debug message doesn't do anybody any good
>> (and it doesn't) then removing the debug message is a fine way of
>> solving the problem.
>
>
> True. But I thought there might be (future) side affects of
> cdrom_media_changed() always returning true. Why is it there at all?
I had a quick look at this and basically cdrom_media_changed()
is only valid when there is a disc in the drive. If the drive
is open or empty then it always returns true. There are a couple
of comments saying it's like this to catch buggy drives, but
hence the interface is broken IMHO and should be removed/fixed?
The attached test program illustrates the problem.
Padraig.
[-- Attachment #2: tcd.c --]
[-- Type: text/plain, Size: 939 bytes --]
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/ioctl.h>
#include <linux/cdrom.h>
/* drives have capabilities (CDC*) like CDC_MEDIA_CHANGED.
These done with CDROM_SET_OPTIONS ioctl. perhaps magicdev
should turn this off as it doesn't use anyway? */
int main(void) {
int cd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK); /* This causes VFS: disk change ... */
while(1) {
//int cd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK);
printf ("media changed[%d]\n", ioctl(cd, CDROM_MEDIA_CHANGED, CDSL_CURRENT));
/*
switch (ioctl(cd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) {
case CDS_DISC_OK: printf("DISK_OK\n"); break;
case CDS_TRAY_OPEN: printf("TRAY_OPEN\n"); break;
case CDS_DRIVE_NOT_READY: printf("DRIVE_NOT_READY\n"); break;
default: printf("default\n"); break;
}
*/
//close(cd);
sleep(2);
}
}
next prev parent reply other threads:[~2002-06-05 22:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-02 13:55 Need help tracing regular write activity in 5 s interval Matthias Andree
2002-06-04 11:21 ` Padraig Brady
2002-06-04 11:41 ` Muli Ben-Yehuda
2002-06-04 11:43 ` Xavier Bestel
2002-06-04 12:04 ` Erik Andersen
2002-06-05 14:08 ` Padraig Brady
2002-06-05 15:13 ` Padraig Brady
2002-06-05 15:50 ` Owen Taylor
2002-06-05 16:43 ` Padraig Brady
2002-06-05 22:22 ` Padraig Brady [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-06-02 15:25 Thunder from the hill
2002-06-02 15:41 ` Kevin Krieser
2002-06-02 16:12 ` Kenneth Johansson
2002-06-02 20:19 ` Matthias Andree
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=3CFE8F11.8060304@antefacto.com \
--to=padraig@antefacto.com \
--cc=andersen@codepoet.org \
--cc=dalecki@evision-ventures.com \
--cc=linux-kernel@vger.kernel.org \
--cc=otaylor@redhat.com \
/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