On Tue, 2005-11-15 at 10:41 +0000, Anton Altaparmakov wrote:
> On Mon, 14 Nov 2005, Yura Pakhuchiy wrote:
> > Changes by: cha0smaster
> >
> > Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
> > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18573/libntfs
> >
> > Modified Files:
> > attrib.c
> > Log Message:
> > Automatically update access and change time in ntfs_attr_p{read,write} and ntfs_attr_truncate.
> >
> >
> > Index: attrib.c
> > ===================================================================
> > RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
> > retrieving revision 1.195
> > retrieving revision 1.196
> > diff -u -p -r1.195 -r1.196
> > --- attrib.c 14 Nov 2005 00:17:19 -0000 1.195
> > +++ attrib.c 14 Nov 2005 15:31:23 -0000 1.196
> > @@ -55,6 +55,7 @@
> > #include "compress.h"
> > #include "bitmap.h"
> > #include "logging.h"
> > +#include "ntfstime.h"
> >
> > ntfschar AT_UNNAMED[] = { const_cpu_to_le16('\0') };
> >
> > @@ -769,6 +770,12 @@ s64 ntfs_attr_pread(ntfs_attr *na, const
> > errno = EACCES;
> > return -1;
> > }
> > + /* Update access time if accessing unnamed data attribute. */
> > + if (na->type == AT_DATA && na->name == AT_UNNAMED) {
> > + na->ni->last_access_time = time(NULL);
> > + NInoFileNameSetDirty(na->ni);
> > + NInoSetDirty(na->ni);
> > + }
>
> This is a bug... You can't do atime updates on read-only volumes. You
> need to check if the volume is read-only and only if not perform the
> update. This breaks the entirety of libntfs/ntfsprogs that use
> read-only mounts for sure.
A lot of utils use read-only mounts if --no-action option passed to
them, they call ntfs_attr_pwrite and it is OK, but why updating atime is
evil in this case?
--
Best regards,
Yura
|