cannot write to file

Glauber Costa glommer at redhat.com
Mon Oct 20 13:06:15 PDT 2008


On Mon, Oct 13, 2008 at 12:04:17PM -0700, Zach Brown wrote:
> 
> > Please let me know whether or not there's something you suspect of, otherwise I'll go back to this
> > sometime next week.
> 
> That sounds entirely possible, yeah.
> 
> One of the cool things that the crfs vfs paths do is perform atomic
> changes across the set of items which make up a file system operation.
> For example, it will only start modifying the items involved in a rename
> once it is sure that all the modifications will succeed.  It doesn't
> have to worry about storing previous state so that it can be restored
> when an error occurs part-way through the process.
> 
> But the code that implements this is pretty fiddly and involves
> confusing callbacks, for a number of reasons.
> 
> It sounds like this bug is hiding somewhere in how the commit_write path
> passes a pointer to an on-stack variable to those callbacks.  It's not
> surprising at all.
> 
> At the moment I'm focusing on moving CRFS to use the modern BTRFS
> back-end.  If it works out the project will be making a huge leap
> forward.  With that out of the way 'll be able to go back and start to
> back-fill in some of the more incomplete bits.
> 
> If there are specific things I can do to help you look into this before
> I get around to it, let me know.
> 
> - z
I'm ashamed it took me so long to find this out ;-)

Anyway, here it is

-------------- next part --------------
# HG changeset patch
# User Glauber Costa <glommer at redhat.com>
# Date 1224538544 7200
# Node ID 94d21b43f7051aa34fee550868cba73dca38dd08
# Parent  158e83047a26f102615fbbefaa47a1cd9816ee66
alloc space for storing the crc.

Currently, we declare a field for storing the crc, but save no space
for it in its structure. It creates weird behaviours like stack corruptions
some times.

Signed-off-by: Glauber Costa <glommer at redhat.com>

diff -r 158e83047a26 -r 94d21b43f705 include/crfs-shared/wire.h
--- a/include/crfs-shared/wire.h	Thu Oct 02 15:57:41 2008 -0300
+++ b/include/crfs-shared/wire.h	Mon Oct 20 19:35:44 2008 -0200
@@ -132,7 +132,7 @@
  * should be.
  */ 
 struct crfs_csum_item {
-	le32 crc32c[0];
+	le32 crc32c[1];
 } __attribute__ ((__packed__));
 
 /*


More information about the crfs-devel mailing list