Re: FUSE: write() after release()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 17, 2018 at 9:24 AM, Oleg Chernovskiy <kanedias@xxxxxxxx> wrote:
> The problem is, I initially tried implementing fs thinking that release call
> is executed if there are no open instances of file.
>
> Isn't that the case for non-fuse filesystems?

There's some amount of confusion here because of the way file handles
can be duplicated on UNIX (e.g. by dup() or fork(), etc).   So
remember the difference between file descriptor (which references an
open file) and the open file itself.

1) If you call open(2) twice on the same path, you'll get two open
files, and hence you'll get two releases when the files are closed.

2) If you call open(2) once, then dup(), and then close the first fd,
you'll *not* get a release (only a flush, which is called on every
close(2)).  When you close the second file descriptor, only then
you'll get the release.

I think this is documented pretty well in the fuse header files.

Thanks,
Miklos



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux