From: Mark H. <mar...@hu...> - 2006-07-14 10:27:53
|
Hi, I encountered a problem when using fuse and stressing my filesystem with fsstress from LTP. It is possible for the fuse code to call unlink in my fuse filesystem before all releases of an open file have completed (tested with file hiding on). A case: file XX is open 3 times by 3 different threads unlink is called on that file fuse sees open count is not zero and hides file Now it is possible that unlink on the hidden file is called in my fuse filesystem before all releases are done executing, for example thread 1 currently runs close() fuse_release() --open //(becomes 2) myfuse->release() linux switches threads to 2 close() fuse_release() --open //(becomes 1) myfuse->release() linux switches threads to 3 close() fuse_release() --open //(becomes 0) myfuse->release() myfuse->release() finished myfuse->unlink() myfuse->unlink() finished fuse_release() finished linux switches threads to 1 myfuse->release() continues when file is already unlinked Shouldn't the decrementing of --node->open_count; in lib/fuse.c:fuse_release() come after if (f->op.release) fuse_do_release(f, path, fi); and before if(unlink_hidden && path) f->op.unlink(path); Regards, Mark |