« Return to Thread: Contradicting create() behaviour

Contradicting create() behaviour

by Gilad Rom-3 :: Rate this Message:

Reply to Author | View in Thread

Hi,

I'm currently implementing a network-based file system using FUSE, and I
must say that you guys have done a great job! It took me no time at all
to get up and running, and now, two days later, my file system <-> FUSE
plug-in is almost done. One big issue remains:

When i use 'touch' to create a file, I see that FUSE issues
a getattr() call, gets a -ENOENT from me, and the proceeds
to create the file and verify it's there using an other getattr().
So far so good.

When I issue a cp command to copy a file into the FS, I see
FUSE run three getattr() calls in a row, and then proceed to run
create(), which is immediately followed by release(), presumably because
the previous calls to getattr() failed, even though they were called
BEFORE create(), so they should have. Obviously, my cp command fails
because of that.

For example (tmp is the directory mounted using FUSE):

$ cp /home/gilad/Manager tmp/newfile13

unique: 2511, opcode: LOOKUP (1), nodeid: 1, insize: 50
LOOKUP /newfile13
getattr: /newfile13
getattr: file not found, return -2
   unique: 2511, error: -2 (No such file or directory), outsize: 16
unique: 2512, opcode: LOOKUP (1), nodeid: 1, insize: 50
LOOKUP /newfile13
getattr: /newfile13
getattr: file not found, return -2
   unique: 2512, error: -2 (No such file or directory), outsize: 16
unique: 2513, opcode: LOOKUP (1), nodeid: 1, insize: 50
LOOKUP /newfile13
getattr: /newfile13
getattr: file not found, return -2
   unique: 2513, error: -2 (No such file or directory), outsize: 16
unique: 2514, opcode: CREATE (35), nodeid: 1, insize: 58
   NODEID: 3
release: closing file /newfile13
delete: 3
   unique: 2514, error: -5 (Input/output error), outsize: 16

-- END EXAMPLE --

Again, using 'touch' seems to call the functions in the right order,
When I try the cp command again, after the file was created, it
succeeds.
any reason for such contradicting behavior? What am I missing?

Using Ubuntu 8.04, stock fuse kernel module and lib.
Thanks,

Gilad


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
fuse-devel mailing list
fuse-devel@...
https://lists.sourceforge.net/lists/listinfo/fuse-devel

 « Return to Thread: Contradicting create() behaviour

LightInTheBox - Buy quality products at wholesale price!