[fuse] interaction between O_APPEND and writeback cache

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

 



Hello,

I am confused about how O_APPEND is supposed to interact with the
writeback cache.

As far as I can tell, the O_APPEND flag is currently passed to the
filesystem process, so my expectation is that the filesystem process is
responsible for ignoring any offset in write requests and instead write
at the current end of the file[1].

However, with writeback cache enabled the filesystem process cannot tell
which data is "new" and came from userspace, should be appended, and
which data is old and just made a round-trip to the kernel. So it seems
to me that the filesystem process should probably leave the handling of
O_APPEND to the kernel. But then, shouldn't the kernel filter out this
flag when sending the open request?

On the other hand, when the kernel handles O_APPEND, then it is no
longer atomic (think of a network fuse filesystem).


It seems to me something is not right here. Either the kernel should
enforce O_APPEND when writeback caching is enabled and filter out the
flag (sacrificing atomicity), or the kernel should pass O_APPEND to the
filesystem but either disable writeback caching or somehow keep track of
what data is actually new.

Am I missing something?


(At first I thought that maybe the filesystem's write is supposed to
ignore data that comes before the current end of the file if writeback
caching is active. But that wouldn't work for a network filesystem
either).


Best,
-Nikolaus

[1]: Actually, if the offset is bigger than the size of the file, should
it be ignored or should the file be extended?

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«




[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