mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Steve French <smfrench@austin.rr.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: ctime set by truncate even if NOCMTIME requested
Date: Mon, 19 Sep 2005 14:58:23 -0400	[thread overview]
Message-ID: <1127156303.8519.29.camel@lade.trondhjem.org> (raw)
In-Reply-To: <432EFAB1.4080406@austin.rr.com>

må den 19.09.2005 Klokka 12:51 (-0500) skreiv Steve French:
> I am seeing requests to set ctime on truncate which does not make any 
> sense to me as I was testing with the flag that should have turned that 
> off.  ie my inodes having S_NOCMTIME set, as NFS does.
> 
> do_truncate (line 206 of open.c) sets
>       newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME
> instead of
>        newattrs.ia_valid = ATTR_SIZE;
>       if(!IS_NOCMTIME(inode))
>            newattrs.ia_valid |= ATTR_CTIME;
> 
> I thought that the correct way to handle this for network filesystems, 
> is to let the server set the mtime and ctime unless the application 
> explicitly sets the attributes (in the case of the sys call truncate or 
> ftruncate the application is not explicitly setting the ctime/mtime as 
> it would on a backup/restore so they should be ignored for the network 
> fs so the server will set it correctl to its time, reducing traffic and 
> more accurately representing the time it got updated).
> 
> Shouldn't there be a IS_NOCMTIME check in the truncate path in fs/open.c?

See the discussion on this a couple of weeks back.

It is quite correct for the kernel to request that the filesystem set
ctime/mtime on successful calls to open(O_TRUNC).
  http://www.opengroup.org/onlinepubs/009695399/toc.htm

It is _incorrect_ for it to request that ctime/mtime be set (or that the
suid/sgid mode bit be cleared) if a truncate()/ftruncate() call results
in no size change.
  http://www.opengroup.org/onlinepubs/009695399/toc.htm

So the current do_truncate() does have to be changed. Adding a check for
IS_NOCMTIME would be wrong, though.

Cheers,
  Trond


  reply	other threads:[~2005-09-19 18:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-19 17:51 Steve French
2005-09-19 18:58 ` Trond Myklebust [this message]
2005-09-19 20:58   ` Steve French
2005-09-19 21:28     ` Trond Myklebust
     [not found]       ` <432F5968.1020106@austin.rr.com>
2005-09-20  1:36         ` Trond Myklebust
2005-09-20  2:16           ` Steve French
2005-09-20 12:11             ` Andreas Dilger
2005-09-20  8:52           ` Miklos Szeredi
2005-09-20 10:05             ` Miklos Szeredi
2005-09-20 12:12               ` Trond Myklebust
2005-09-20 12:20                 ` Miklos Szeredi
2005-09-20 12:27                   ` Trond Myklebust
2005-09-20  8:48   ` Miklos Szeredi

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=1127156303.8519.29.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smfrench@austin.rr.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

all inboxes | Powered by JetHome®