Re: [PATCH] 9p: Fix initialisation of netfs_inode for 9p

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

 



David Howells wrote on Tue, Jan 02, 2024 at 09:49:39PM +0000:
> This needs a fix that I would fold in.  Somehow it gets through xfstests
> without it, but it seems problems can be caused with executables.

Looking at a file without that patch we seem to be reading just zeroes
off pre-existing files; I'm surprised xfstest doesn't have a write
something/umount/mount/check content is identical test...

(You're probably aware of this, but note for others this breaks with the
rest of the patch series even if the big 9p patch isn't applied -- this
is the main reason I'd rather just get the patch in this cycle, as the
new patches got more tests with the full series than with the 9p writes
patch dropped.)


> 9p: Fix initialisation of netfs_inode for 9p
> 
> The 9p filesystem is calling netfs_inode_init() in v9fs_init_inode() -
> before the struct inode fields have been initialised from the obtained file
> stats (ie. after v9fs_stat2inode*() has been called), but netfslib wants to
> set a couple of its fields from i_size.

Would it make sense to just always update netfs's ctx->remote_i_size in
the various stat2inode calls instead?
We don't have any cache coherency so if a file changes beneath us
through an edit on the server (or through another client) hell will
break loose anyway, but stat would update the inode's i_size so it'll
likely be weird that the remote_i_size doesn't get updated.


> Reported-by: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
> Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
> Tested-by: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
> cc: Eric Van Hensbergen <ericvh@xxxxxxxxxx>
> cc: Latchesar Ionkov <lucho@xxxxxxxxxx>
> cc: Dominique Martinet <asmadeus@xxxxxxxxxxxxx>

With that being said, it seems to do the immediate job:
Acked-by: Dominique Martinet <asmadeus@xxxxxxxxxxxxx>

-- 
Dominique Martinet | Asmadeus




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux