This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 500742 - tar --atime-preserve errors with read-only source
tar --atime-preserve errors with read-only source
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: tar (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-13 17:19 EDT by Bruce Jerrick
Modified: 2009-07-24 15:43 EDT (History)
2 users (show)

See Also:
Fixed In Version: 1.20-6.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-24 15:43:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Bruce Jerrick 2009-05-13 17:19:39 EDT
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 07:56:15 EDT
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 04:54:27 EDT
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 02:51:49 EDT
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 15:43:25 EDT
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.