linux/fs
NeilBrown 4a30131e7d [PATCH] Fix some problems with truncate and mtime semantics.
SUS requires that when truncating a file to the size that it currently
is:
  truncate and ftruncate should NOT modify ctime or mtime
  O_TRUNC SHOULD modify ctime and mtime.

Currently mtime and ctime are always modified on most local
filesystems (side effect of ->truncate) or never modified (on NFS).

With this patch:
  ATTR_CTIME|ATTR_MTIME are sent with ATTR_SIZE precisely when
    an update of these times is required whether size changes or not
    (via a new argument to do_truncate).  This allows NFS to do
    the right thing for O_TRUNC.
  inode_setattr nolonger forces ATTR_MTIME|ATTR_CTIME when the ATTR_SIZE
    sets the size to it's current value.  This allows local filesystems
    to do the right thing for f?truncate.

Also, the logic in inode_setattr is changed a bit so there are two return
points.  One returns the error from vmtruncate if it failed, the other
returns 0 (there can be no other failure).

Finally, if vmtruncate succeeds, and ATTR_SIZE is the only change
requested, we now fall-through and mark_inode_dirty.  If a filesystem did
not have a ->truncate function, then vmtruncate will have changed i_size,
without marking the inode as 'dirty', and I think this is wrong.

Signed-off-by: Neil Brown <neilb@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:13:52 -08:00
..
9p [PATCH] Fix and add EXPORT_SYMBOL(filemap_write_and_wait) 2006-01-08 20:13:47 -08:00
adfs
affs
afs
autofs
autofs4
befs
bfs
cifs [PATCH] Fix and add EXPORT_SYMBOL(filemap_write_and_wait) 2006-01-08 20:13:47 -08:00
coda
configfs
cramfs
debugfs
devfs
devpts
efs
exportfs
ext2
ext3
fat
freevxfs
fuse
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jffs
jffs2
jfs [PATCH] Fix and add EXPORT_SYMBOL(filemap_write_and_wait) 2006-01-08 20:13:47 -08:00
lockd
minix
msdos
ncpfs
nfs [PATCH] Fix and add EXPORT_SYMBOL(filemap_write_and_wait) 2006-01-08 20:13:47 -08:00
nfs_common
nfsd
nls
ntfs
ocfs2 [PATCH] This patch contains the following cleanups: 2006-01-03 11:45:55 -08:00
openpromfs
partitions
proc
qnx4
ramfs
reiserfs
relayfs [PATCH] relayfs: cleanup, change relayfs_file_* to relay_file_* 2006-01-08 20:13:51 -08:00
romfs
smbfs [PATCH] Fix and add EXPORT_SYMBOL(filemap_write_and_wait) 2006-01-08 20:13:47 -08:00
sysfs
sysv
udf [PATCH] udf: remove bogus inode == NULL check in inode_bmap 2006-01-08 20:13:51 -08:00
ufs
vfat
xfs [PATCH] Fix and add EXPORT_SYMBOL(filemap_write_and_wait) 2006-01-08 20:13:47 -08:00
aio.c [PATCH] rcu file: use atomic primitives 2006-01-08 20:13:48 -08:00
attr.c [PATCH] Fix some problems with truncate and mtime semantics. 2006-01-08 20:13:52 -08:00
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c
block_dev.c
buffer.c [PATCH] Fix and add EXPORT_SYMBOL(filemap_write_and_wait) 2006-01-08 20:13:47 -08:00
char_dev.c
compat_ioctl.c
compat.c
dcache.c
dcookies.c
direct-io.c
dnotify.c
dquot.c
drop_caches.c
eventpoll.c
exec.c [PATCH] Fix some problems with truncate and mtime semantics. 2006-01-08 20:13:52 -08:00
fcntl.c
fifo.c
file_table.c [PATCH] rcu file: use atomic primitives 2006-01-08 20:13:48 -08:00
file.c
filesystems.c
fs-writeback.c
inode.c
inotify.c
ioctl.c
ioprio.c
Kconfig
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c
mpage.c
namei.c [PATCH] Fix some problems with truncate and mtime semantics. 2006-01-08 20:13:52 -08:00
namespace.c
nfsctl.c
open.c [PATCH] Fix some problems with truncate and mtime semantics. 2006-01-08 20:13:52 -08:00
pipe.c
pnode.c
pnode.h
posix_acl.c
quota_v1.c
quota_v2.c
quota.c
read_write.c
readdir.c
select.c
seq_file.c
stat.c
super.c
xattr_acl.c
xattr.c