Bug 660687 - guestmount: "touch" command fails: touch: setting times of `timestamp': Invalid argument
Summary: guestmount: "touch" command fails: touch: setting times of `timestamp': Inval...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Pino Toscano
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-07 15:40 UTC by Richard W.M. Jones
Modified: 2014-01-16 16:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-16 16:26:14 UTC
Embargoed:


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

Description Richard W.M. Jones 2010-12-07 15:40:50 UTC
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 ]
  done
done
-------------------------------

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 15:42:19 UTC
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 11:13:57 UTC
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 12:41:21 UTC
I think this is a FUSE problem, or at least I can't work
out what's going on.  Asked on fuse-devel:
http://sourceforge.net/mailarchive/message.php?msg_id=26780130

Comment 4 Pino Toscano 2013-12-12 15:54:40 UTC
Fixed by
https://github.com/libguestfs/libguestfs/commit/1877c106030361821cf36c8873455d0c3d7134d3
which is in libguestfs >= 1.25.14.

Comment 5 Richard W.M. Jones 2014-01-07 13:47:36 UTC
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 16:26:14 UTC
Hopefully fixed for good (I would hope, now) with
https://github.com/libguestfs/libguestfs/commit/99d6e2c84ef490feb6ff2e37e4b0684f34bac554
which is in libguestfs >= 1.25.22.


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