Re: [PATCH] fuse: update size attr before doing IO

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

 



On Thu, Mar 07, 2024 at 10:08:13AM -0500, Sweet Tea Dorminy wrote:
> All calls into generic vfs functions need to make sure that the inode
> attributes used by those functions are up to date, by calling
> fuse_update_attributes() as appropriate.
> 
> generic_write_checks() accesses inode size in order to get the
> appropriate file offset for files opened with O_APPEND. Currently, in
> some cases, fuse_update_attributes() is not called before
> generic_write_checks(), potentially resulting in corruption/overwrite of
> previously appended data if i_size is out of date in the cached inode.
> 
> Therefore,  make sure fuse_update_attributes() is always
> called before generic_write_checks(), and add a note about why it's not
> necessary for some llseek calls.
> 
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@xxxxxxxxxx>

I had to ask questions and go look at the code, mostly because I'm not a FUSE
developer.  fuse_update_attributes() doesn't actually do anything if the stats
aren't invalidated, I was concerned we were suddenly adding a lot of overhead
for every write call.

Reviewed-by: Josef Bacik <josef@xxxxxxxxxxxxxx>

I have a question for the normal FUSE developers, how would one test this?
There doesn't appear to be a mechanism for writing stub FUSE fs's to exercise a
case like this in fstests.  Is there some other way you guys would test this or
is this something we need to build out ourselves?  Thanks,

Josef




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

  Powered by Linux