Bug 500742 - tar --atime-preserve errors with read-only source
Summary: tar --atime-preserve errors with read-only source
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tar
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-13 21:19 UTC by Bruce Jerrick
Modified: 2009-07-24 19:43 UTC (History)
2 users (show)

Fixed In Version: 1.20-6.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-24 19:43:30 UTC


Attachments (Terms of Use)
Patch to ignore EROFS for source file on ro fs (515 bytes, patch)
2009-05-15 11:56 UTC, Ondrej Vasik
no flags Details | Diff

Description Bruce Jerrick 2009-05-13 21:19:39 UTC
Description of problem:
tar (tar-1.20-5.fc10) is a bit stupid about applying --atime-preserve to
  a source file on a read-only filesystem -- it tries utime() to reset the
  atime, and that fails.  Of course it isn't necessary on a read-only
  filesystem.

Version-Release number of selected component (if applicable):
tar-1.20-5.fc10

How reproducible:
100%

Steps to Reproduce:
1. tar -cf /dev/null --atime-preserve narf
where narf is a file on a read-only filesystem.
  
Actual results:
tar: narf: Cannot utime: Read-only file system
tar: Error exit delayed from previous errors

Expected results:
No errors

Additional info:
The easiest fix is probably to just let the utime() call determine if the
  file is on a read-only filesystem -- it has a return value EROFS just for
  that, which could then be ignored.  That may not be optimally efficient,
  but it would minimize race conditions.

Comment 1 Ondrej Vasik 2009-05-15 11:56:15 UTC
Created attachment 344123 [details]
Patch to ignore EROFS for source file on ro fs

Thanks for report... I guess ignoring EROFS for utime() calls in tar should not be done generally - just for that case of source file on read-only file system and --atime-preserve option. Attached patch should solve the issue, tar with this patch build in rawhide as tar-1.22-3.fc12 . I'll propose that patch upstream and make updates for lower Fedora's when accepted.

Comment 2 Fedora Update System 2009-07-10 08:54:27 UTC
tar-1.20-6.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/tar-1.20-6.fc10

Comment 3 Fedora Update System 2009-07-16 06:51:49 UTC
tar-1.20-6.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update tar'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-7550

Comment 4 Fedora Update System 2009-07-24 19:43:25 UTC
tar-1.20-6.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.


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