All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Sergei Zhirikov <sfzhi@yahoo.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: Mounting UBIFS readonly - is it really readonly?
Date: Mon, 23 Aug 2010 22:14:21 +0300	[thread overview]
Message-ID: <1282590861.16502.104.camel@brekeke> (raw)
In-Reply-To: <752212.66527.qm@web112313.mail.gq1.yahoo.com>

On Mon, 2010-08-23 at 11:33 -0700, Sergei Zhirikov wrote:
> I made the changes you suggested earlier to see if/when something is
> written and the results were quite unexpected. Just as I assumed,
> UBIFS remains mounted read-only all the time. But contrary to what I
> expected, none of the functions related to writing is ever called.
> Nevertheless, the timestamp still changes.
> 
> I have also managed to reproduce the issue without involving system
> reboot. If I create a device node equivalent to /dev/console (major 5,
> minor 1) in any directory (on the root UBIFS) and then remount the FS
> read-only, the timestamp of the device node keeps changing upon any
> write operation to the device. The same thing happens when I
> try /dev/tty (major 5, minor 0), but with /dev/null (1,3) or /dev/zero
> (1,5) the timestamp does not change.

This suggests this is not VFS but tty-specific.

> I'm now even more puzzled than I was in the beginning. It looks like
> the VFS decides to update the timestamp for some reason, but does not
> pass that change to UBIFS (perhaps, because it knows the latter is
> read-only). So the updated timestamp exists only cached in memory and
> is never actually written to the FS. I haven't tried to verify that
> theory yet (which shouldn't be difficult).

It's late here and I'm heading to the bed, but while passing by my
computer I've quickly took a look and I can see the following in
drivers/char/tty_io.c:

tty_write() cales do_tty_write() which changes mtime:

inode->i_mtime = current_fs_time(inode->i_sb);

So it looks like this is a feature - ever write to /dev/console changes
mtime. It looks like [amc]time for device nodes are not always FS inode
times, but they may belong to the _driver_ which is represented by the
character device. I guess tty is just very special and this might be
just legacy stuff.

I might be mistaking though, good night :-)

Artem.

      reply	other threads:[~2010-08-23 19:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27 19:05 Mounting UBIFS readonly - is it really readonly? Sergei Zhirikov
2010-08-05  4:51 ` Artem Bityutskiy
2010-08-23 12:23 ` Artem Bityutskiy
2010-08-23 12:41   ` Artem Bityutskiy
2010-08-23 18:33     ` Sergei Zhirikov
2010-08-23 19:14       ` Artem Bityutskiy [this message]

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=1282590861.16502.104.camel@brekeke \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=sfzhi@yahoo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.