On Thu, Aug 28, 2014 at 09:13:38AM -0400, Roland Mainz wrote:
----- Original Message -----
> From: "Jakub Hrozek" <jhrozek(a)redhat.com>
> To: sssd-devel(a)lists.fedorahosted.org
> Sent: Tuesday, August 26, 2014 2:01:57 PM
> Subject: Re: [SSSD] Atomic |rename()| ... / was: Re: [PATCH]
https://fedorahosted.org/sssd/ticket/2410
>
> On Tue, Aug 26, 2014 at 07:05:17AM -0400, Roland Mainz wrote:
> > > I like your approach better and do not expect any issues since rename()
> > > is expected to be atomic.
> > >
> > > Please find comments below.
> >
> > Erm... |rename(src, dest)| with |src| and |dest| in the same directory can
> > be considered an atomic operation... beyond that you're up to the mercy of
> > the filesystem implementation.
>
> As I found the hard way, see my other e-mail :-)
Details, please. There is some discussion on the way to make a variant of|renameat()|
with a flags field to provide an option to request a swap operation... and an
|RENAMEAT_MUSTBE_ATOMIC| might fit in their neatly... :-)
What I meant is that when the ccache was created in /tmp by default,
which is a tmpfs mount on Fedora these days, rename failed with an error
message (errno=EXDEV, strerror=Cross-device link)