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.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|