Comments (5)
I actually ran into this very bug with rsync last night, thanks for finding it.
I'll
apply the change and write a test when I have the time.
Original comment by [email protected]
on 28 Apr 2009 at 3:55
- Changed state: Accepted
from fusecompress.
Speaking of rsync, I found another related issue. rsync sets the mtime/atime
for
symbolic links to the same value as the source link. The current fusecompress
uses
utime() which sets the target file's atime/mtime, not the link's. At first I
thought
this might be an unsolvable problem since fuse only provides a utime interface
(not
lutimes()) but then when I watched the DEBUG messages I saw that fuse
dereferences,
or doesn't dereference, the link before calling fusecompress as appropriate.
So, if
rsync tried to set mtime for the link, fuse calls fuse_compress.utime() with
the link
filename. If rsync tries to set the mtime for the target file, fuse calls
fuse_compress.utime() with the target filename.
Anyway, I found that using lutimes() instead of utime() fixes the problem.
My testing seems to show that the behavior is what you would expect. If you
use the
"touch" command, which always modifies the target not the link, on the link the
target is modified. However, if you run lutimes() against the link (I have a
little
C program that's useful testing, and I'll attach it) the link is updated. I
believe
that this change is correct but, of course, it should be tested more thoroughly.
This diff includes the first change too:
--- fusecompress.c (revision 90)
+++ fusecompress.c (working copy)
@@ -112,7 +112,7 @@
// (tar checks this item and it is loudly when the result
// is different than what it exepects)
//
- stbuf->st_ctime = stbuf->st_mtime;
+ //stbuf->st_ctime = stbuf->st_mtime;
UNLOCK(&file->lock);
return 0;
@@ -436,12 +436,25 @@
static int fusecompress_utime(const char *path, struct utimbuf *buf)
{
const char *full;
-
+ struct timeval timesval[2];
+ struct timeval *timesbuf=NULL;
+
full = fusecompress_getpath(path);
- if (utime(full, buf) == -1)
+ DEBUG_("('%s')", full);
+
+ if (buf != NULL)
+ {
+ timesval[0].tv_usec = 0;
+ timesval[1].tv_usec = 0;
+ timesval[0].tv_sec = buf->actime;
+ timesval[1].tv_sec = buf->modtime;
+ timesbuf=timesval;
+ }
+
+ if (lutimes(full,timesbuf) == -1)
return -errno;
-
+
return 0;
}
Original comment by [email protected]
on 28 Apr 2009 at 7:02
Attachments:
from fusecompress.
Original comment by [email protected]
on 3 May 2009 at 9:51
- Added labels: Milestone-0.9.2
from fusecompress.
This issue was closed by r96.
Original comment by [email protected]
on 28 Jul 2009 at 4:28
- Changed state: Fixed
from fusecompress.
Patch added in r96. Thanks for your contribution.
Original comment by [email protected]
on 28 Jul 2009 at 4:29
from fusecompress.
Related Issues (20)
- fusecompress_offline leaves temp files behind when aborted HOT 1
- fusecompress_offline does not work when used across mountpoints
- fusecompress_offline -v option undocumented HOT 2
- fusecompress_offline ignores exclusion list HOT 1
- change options at runtime
- Filesystem crashes when writing large files via samba share HOT 2
- test suite broken on OSX HOT 1
- fusecompress eats up memory when reading a file HOT 1
- fusecompress_offline hangs for 50 seconds if it cannot create a temp file
- Don't do setpriority() or make nice level configurable. HOT 2
- rsync defies exclusion list HOT 2
- directory timestamps modified behind user's back
- symlinks are created with filesystem uid, not user uid HOT 2
- Memory leak when cache option used? HOT 2
- project is not ready to use with direct_io option (while cache is in effect)
- hang during some kubuntu packages update
- Compress Files only on size saving
- du reports compressed size, not actual size. HOT 1
- Assertion `pthread_mutex_lock(&file->lock) == 0' failed.
- ./configure: line 5338: syntax error near unexpected token `fuse,' ./configure: line 5338: `PKG_CHECK_MODULES(fuse, fuse >= 2.2)' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fusecompress.