Hello,

Does anyone here have an insight into why setattr returns ENOENT when
the actually file exists?

I'm in the relatively early stages of building a macfuse filesystem
and am encountering this problem while testing the following command:

$ echo "xxx" > /Volumes/fs/a.txt

File /a.txt already exists and was created with the touch command.

Here's the macfuse debug output:

----------------
unique: 1, opcode: LOOKUP (1), nodeid: 1, insize: 46
LOOKUP /a.txt
   NODEID: 2
   unique: 1, error: 0 (Unknown error: 0), outsize: 152
unique: 4, opcode: OPEN (14), nodeid: 2, insize: 48
   unique: 4, error: 0 (Unknown error: 0), outsize: 32
OPEN[1067568] flags: 0x1 /a.txt
unique: 0, opcode: SETATTR (4), nodeid: 2, insize: 168
   unique: 0, error: -2 (No such file or directory), outsize: 16
unique: 3, opcode: FLUSH (25), nodeid: 2, insize: 64
FLUSH[1067568]
   unique: 3, error: 0 (Unknown error: 0), outsize: 16
unique: 2, opcode: RELEASE (18), nodeid: 2, insize: 64
RELEASE[1067568] flags: 0x1
   unique: 2, error: 0 (Unknown error: 0), outsize: 16
----------------

The log shows that open of nodeid 2 returned successfully. Why then
does the subsequent call to setattr with the same nodeid fail?

I poked around in the fuse library source and found that the call to
get_path() in function fuse_lib_setattr() is the likely culprit. This
seems odd because I can 'stat' the file and getattr also calls get_path
() with the same nodeid.

Here's the output from the stat command:

>> File.stat("/Volumes/sfs/a.txt")
=> #<File::Stat dev=0x2e000086, ino=2, mode=0100644, nlink=1, uid=501,
gid=501, rdev=0x0, size=0, blksize=65536, blocks=0, atime=Fri Jul 10
08:31:29 -0400 2009, mtime=Fri Jul 10 08:31:29 -0400 2009, ctime=Fri
Jul 10 08:31:29 -0400 2009>

I don't think I'm abusing the fuse API (although I probably am). For
example, I don't overwrite fuse's internal inode numbers with my own.

Any thoughts on where to look would be appreciated.

Thanks!





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MacFUSE" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/macfuse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to