public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* updating mtime for char/block devices?
@ 2005-02-27 23:51 Carl-Daniel Hailfinger
  2005-02-28  7:47 ` Arjan van de Ven
  0 siblings, 1 reply; 7+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-02-27 23:51 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,

is it intentional that
echo foo >/dev/hda1
doesn't update the mtime of the device node, but
echo foo >/dev/tty10
does update the mtime of the device node?

And no, mounting with the noatime flag doesn't help because the
mtime is updated. IIRC some time ago this behaviour was different,
but I could easily be mistaken.

Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/

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

* Re: updating mtime for char/block devices?
  2005-02-27 23:51 updating mtime for char/block devices? Carl-Daniel Hailfinger
@ 2005-02-28  7:47 ` Arjan van de Ven
  2005-03-01  0:45   ` Carl-Daniel Hailfinger
  0 siblings, 1 reply; 7+ messages in thread
From: Arjan van de Ven @ 2005-02-28  7:47 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger; +Cc: Linux Kernel Mailing List

On Mon, 2005-02-28 at 00:51 +0100, Carl-Daniel Hailfinger wrote:
> Hi,
> 
> is it intentional that
> echo foo >/dev/hda1
> doesn't update the mtime of the device node, but
> echo foo >/dev/tty10
> does update the mtime of the device node?
> 
> And no, mounting with the noatime flag doesn't help because the
> mtime is updated. IIRC some time ago this behaviour was different,
> but I could easily be mistaken.

devices are tricky in general in this respect, /dev may be mounted read
only for example ;)



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

* Re: updating mtime for char/block devices?
  2005-02-28  7:47 ` Arjan van de Ven
@ 2005-03-01  0:45   ` Carl-Daniel Hailfinger
  2005-03-01  1:47     ` Valdis.Kletnieks
  2005-03-01  9:37     ` Russell King
  0 siblings, 2 replies; 7+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-03-01  0:45 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Linux Kernel Mailing List

Arjan van de Ven schrieb:
> On Mon, 2005-02-28 at 00:51 +0100, Carl-Daniel Hailfinger wrote:
> 
>>Hi,
>>
>>is it intentional that
>>echo foo >/dev/hda1
>>doesn't update the mtime of the device node, but
>>echo foo >/dev/tty10
>>does update the mtime of the device node?
>>
>>And no, mounting with the noatime flag doesn't help because the
>>mtime is updated. IIRC some time ago this behaviour was different,
>>but I could easily be mistaken.
> 
> 
> devices are tricky in general in this respect, /dev may be mounted read
> only for example ;)

Sorry for not specifying my real problem which is preventing disk access
when my laptop is running on battery.

Can I prevent mtime updates for all device files? Mounting /dev readonly
would certainly help, but for that to work I'd have to move /dev to a
different filesystem, right?


Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/

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

* Re: updating mtime for char/block devices?
  2005-03-01  0:45   ` Carl-Daniel Hailfinger
@ 2005-03-01  1:47     ` Valdis.Kletnieks
  2005-03-01  9:37     ` Russell King
  1 sibling, 0 replies; 7+ messages in thread
From: Valdis.Kletnieks @ 2005-03-01  1:47 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger; +Cc: Arjan van de Ven, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On Tue, 01 Mar 2005 01:45:47 +0100, Carl-Daniel Hailfinger said:

> Sorry for not specifying my real problem which is preventing disk access
> when my laptop is running on battery.
> 
> Can I prevent mtime updates for all device files? Mounting /dev readonly
> would certainly help, but for that to work I'd have to move /dev to a
> different filesystem, right?

Or do what Fedora Core 3 does and use 'udev' to manage a /dev on a tmpfs file system.

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

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

* Re: updating mtime for char/block devices?
  2005-03-01  0:45   ` Carl-Daniel Hailfinger
  2005-03-01  1:47     ` Valdis.Kletnieks
@ 2005-03-01  9:37     ` Russell King
  2005-03-01 11:15       ` Carl-Daniel Hailfinger
  1 sibling, 1 reply; 7+ messages in thread
From: Russell King @ 2005-03-01  9:37 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger; +Cc: Arjan van de Ven, Linux Kernel Mailing List

On Tue, Mar 01, 2005 at 01:45:47AM +0100, Carl-Daniel Hailfinger wrote:
> Can I prevent mtime updates for all device files? Mounting /dev readonly
> would certainly help, but for that to work I'd have to move /dev to a
> different filesystem, right?

tty mtime updates aren't marked dirty, so aren't written back to disk.
Intentionally.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

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

* Re: updating mtime for char/block devices?
  2005-03-01  9:37     ` Russell King
@ 2005-03-01 11:15       ` Carl-Daniel Hailfinger
  2005-03-01 11:19         ` Russell King
  0 siblings, 1 reply; 7+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-03-01 11:15 UTC (permalink / raw)
  To: Russell King; +Cc: Arjan van de Ven, Linux Kernel Mailing List

Russell King schrieb:
> On Tue, Mar 01, 2005 at 01:45:47AM +0100, Carl-Daniel Hailfinger wrote:
> 
>>Can I prevent mtime updates for all device files? Mounting /dev readonly
>>would certainly help, but for that to work I'd have to move /dev to a
>>different filesystem, right?
> 
> 
> tty mtime updates aren't marked dirty, so aren't written back to disk.
> Intentionally.

It seems the tty mtime exception doesn't include /dev/ptmx. That's
probably unintentional. Is there a chance to extend the tty mtime
exception to all char devices or at least major 4+5?

Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/

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

* Re: updating mtime for char/block devices?
  2005-03-01 11:15       ` Carl-Daniel Hailfinger
@ 2005-03-01 11:19         ` Russell King
  0 siblings, 0 replies; 7+ messages in thread
From: Russell King @ 2005-03-01 11:19 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger; +Cc: Arjan van de Ven, Linux Kernel Mailing List

On Tue, Mar 01, 2005 at 12:15:41PM +0100, Carl-Daniel Hailfinger wrote:
> Russell King schrieb:
> > tty mtime updates aren't marked dirty, so aren't written back to disk.
> > Intentionally.
> 
> It seems the tty mtime exception doesn't include /dev/ptmx. That's
> probably unintentional. Is there a chance to extend the tty mtime
> exception to all char devices or at least major 4+5?

It does include /dev/ptmx, at least here with 2.6.11-rc2-bk1 and 2.4
kernels.  In fact, it's common to all tty devices since it's handled
by the generic tty code.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

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

end of thread, other threads:[~2005-03-01 11:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-27 23:51 updating mtime for char/block devices? Carl-Daniel Hailfinger
2005-02-28  7:47 ` Arjan van de Ven
2005-03-01  0:45   ` Carl-Daniel Hailfinger
2005-03-01  1:47     ` Valdis.Kletnieks
2005-03-01  9:37     ` Russell King
2005-03-01 11:15       ` Carl-Daniel Hailfinger
2005-03-01 11:19         ` Russell King

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