From mint-bounce@lists.fishpool.fi  Sat Aug 29 12:07:18 2009
X-Virus-Scanned: amavisd-new at demon.co.uk
Subject: Re: [MiNT] symlinks and hostfs
From: Alan Hourihane <alanh@fairlite.co.uk>
To: Petr Stehlik <pstehlik@sophics.cz>
Cc: mint@lists.fishpool.fi
In-Reply-To: <1251555169.21551.32.camel@joy>
References: <4A97D65D.6090100@freesbee.fr>
	 <1251471399.19057.103.camel@jetpack.demon.co.uk>
	 <1251472068.19057.104.camel@jetpack.demon.co.uk>
	 <4A97F60C.5040903@freesbee.fr>
	 <1251473424.19057.108.camel@jetpack.demon.co.uk>
	 <4A98472E.3010505@freesbee.fr <alpine.LFD.2.00.0908290910390.8181@localhost>
	 <1251532244.3902.18.camel@joy>
	 <alpine.LFD.2.00.0908291226530.8181@localhost>
	 <1251550654.12642.71.camel@joy>
	 <alpine.LFD.2.00.0908291515370.8181@localhost>
	 <1251555169.21551.32.camel@joy>
Content-Type: text/plain; charset="iso-8859-2"
Date: Sat, 29 Aug 2009 17:05:00 +0100
Message-Id: <1251561900.23844.7.camel@jetpack.demon.co.uk>
Mime-Version: 1.0
X-Mailer: Evolution 2.24.5 
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: alanh@fairlite.co.uk
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id n7TG7I5O031826

On Sat, 2009-08-29 at 16:12 +0200, Petr Stehlik wrote:
> Frank Naumann píše v So 29. 08. 2009 v 15:30 +0200:
> 
> > >> The mintlib use the Fstat64() kernel call if available (starting from
> > >> FreeMiNT 1.15.4)
> > >
> > > HostFS implements Fstat64 but AFAIK it's currently disabled because of
> > > the UTC timestamp conversion issue that I've been explaining in this and
> > > other threads several times already.
> > 
> > No, Fstat64() is a system call. It can't be implemented by an xfs, it's 
> > implemented by the kernel. The stat64() call inside the xfs interface is 
> > something different.
> 
> You're right. I was too lazy to use the right terms because I simply
> believed everybody knew already what I meant:
> 
> freemint/sys/xfs/hostfs/hostfs_xfs.c line 250:
> 
> #if 0
> /* This is not used as there are problems with timezone synchronization
>    between FreeMiNT and the NF implementing emulator. */
> static
> long     _cdecl hostfs_fs_stat64     (fcookie *file, STAT *xattr)
> {
> 	return nf_call(HOSTFS(XFS_STAT64), file, xattr);
> }
> #endif
> 
> If we re-read this whole thread we find out that at the very beginning
> Vincent said that because "Fstat64() does not seem to be implemented in
> hostfs, we fall back in Fxattr()" and then questioned the "unused flag".
> Alan quickly jumped in and reported that "this is a bug in aranym. It
> uses it's own host_stat64()". This is where this thread got sort of
> interconnected with the parallel thread "stat() and blocks" because in
> that thread Alan said the same thing about HostFS :-)

Excuse me, but what exactly did I say on the "stat() and blocks"
thread ??

Getting back to my patch, it uses lstat() exclusively in all cases.
Using stat() will end up stat'ing the wrong file when symlinks are being
checked. This looks like a bug in ARAnyM to me, and I've said nothing
more. I've posted a patch to help demonstrate the problem with ARAnyM,
which cures the problem for me, but still has the "absolute" path
problem that Vincent also reported. I suspect with the latest CVS and my
patch, that this is now cured.

Alan.


