Bug 660687 - guestmount: "touch" command fails: touch: setting times of `timestamp': Invalid argument
guestmount: "touch" command fails: touch: setting times of `timestamp': Inval...
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
Unspecified Unspecified
low Severity medium
: ---
: ---
Assigned To: Pino Toscano
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2010-12-07 10:40 EST by Richard W.M. Jones
Modified: 2014-01-16 11:26 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-16 11:26:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Jenkins console output. (384.72 KB, text/plain)
2014-01-07 08:47 EST, Richard W.M. Jones
no flags Details

  None (edit)
Description Richard W.M. Jones 2010-12-07 10:40:50 EST
Description of problem:

Mount an empty filesystem on /tmp/mnt using guestmount, and
run the following script, which is adapted from the test-fuse.sh
script in the fuse/ directory of the sources.

#!/bin/bash -

set -e
set -v

cd /tmp/mnt

while true; do
  for ts in 12345 1234567 987654321; do
    touch -a -d @$ts timestamp
    [ "$(stat -c %X timestamp)" -eq $ts ]
    touch -m -d @$ts timestamp
    [ "$(stat -c %Y timestamp)" -eq $ts ]
    touch    -d @$ts timestamp
    [ "$(stat -c %X timestamp)" -eq $ts ]
    [ "$(stat -c %Y timestamp)" -eq $ts ]

The script may fail with:

touch: setting times of `timestamp': Invalid argument

Version-Release number of selected component (if applicable):

libguestfs 1.7.19
fuse 2.8.4-1.1 (Debian)

How reproducible:

The failure is unpredictable.  On Fedora it doesn't seem to
fail at all, whereas on Debian it fails very frequently.
Comment 1 Richard W.M. Jones 2010-12-07 10:42:19 EST
Seems to be a FUSE issue, because at the point where the
error occurs we aren't inside any guestmount code.

Also small changes to the script make the error go away,
eg. adding a sleep before the 'touch' commands.
Comment 2 Richard W.M. Jones 2010-12-19 06:13:57 EST
It appears to fail the first time after the filesystem
has been mounted, but not thereafter.

$ ./fuse/guestmount -a test1.img -m /dev/sda1 /tmp/mnt
$ /tmp/test.sh
[fails immediately with ...]
touch: setting times of `timestamp': Invalid argument
$ /tmp/test.sh
[runs fine, however long I run it or however many times
I kill and restart it]

Then unmount and remount:

$ fusermount -u /tmp/mnt
$ ./fuse/guestmount -a test1.img -m /dev/sda1 /tmp/mnt 
$ /tmp/test.sh
[fails immediately with ...]
touch: setting times of `timestamp': Invalid argument
Comment 3 Richard W.M. Jones 2010-12-19 07:41:21 EST
I think this is a FUSE problem, or at least I can't work
out what's going on.  Asked on fuse-devel:
Comment 4 Pino Toscano 2013-12-12 10:54:40 EST
Fixed by
which is in libguestfs >= 1.25.14.
Comment 5 Richard W.M. Jones 2014-01-07 08:47:36 EST
Created attachment 846673 [details]
Jenkins console output.

This error occurs in Jenkins testing (with libguestfs.git)
so it looks like it is not actually fixed.
Comment 6 Pino Toscano 2014-01-16 11:26:14 EST
Hopefully fixed for good (I would hope, now) with
which is in libguestfs >= 1.25.22.

Note You need to log in before you can comment on or make changes to this bug.