NetBSD-Bugs archive

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

Re: kern/57134: st_size of stat on vnd raw partition sometimes is 0, causing newfs to fail



The following reply was made to PR kern/57134; it has been noted by GNATS.

From: "J. Hannken-Illjes" <hannken%mailbox.org@localhost>
To: NetBSD GNATS <gnats-bugs%netbsd.org@localhost>
Cc: 
Subject: Re: kern/57134: st_size of stat on vnd raw partition sometimes is 0,
 causing newfs to fail
Date: Sun, 1 Jan 2023 18:51:34 +0100

 > On 1. Jan 2023, at 14:45, Robert Elz <kre%munnari.OZ.AU@localhost> wrote:
 > 
 > It doesn't explain why st_size on a vnd device returns the underlying
 > file size when its inode is on a UFS2 filesystem, but doesn't when it
 > is on a tmpfs or NFS filesystem.   That would be nice to discover.
 
 It (vnode member v_size) gets set from spec_open() around line 1840
 of miscfs/specfs/spec_vnops.c.  While UFS returns vp->v_size on
 getattr call tmpfs returns its internal size tn_size which doesn't
 get updated from spec_open().
 
 Setting the size from spec_open() looks wrong, as a program configuring
 a vnd device may miss the size change if it uses open -> configure ->
 fstat with a single file descriptor.
 
 --
 J. Hannken-Illjes - hannken%mailbox.org@localhost
 


Home | Main Index | Thread Index | Old Index