All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard.weinberger@gmail.com>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Chris Murphy <lists@colorremedies.com>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: Re: Is rename(2) atomic on FAT?
Date: Wed, 23 Oct 2019 23:21:44 +0200	[thread overview]
Message-ID: <CAFLxGvxCVNy0yj8SQmtOyk5xcmYag1rxe3v7GtbEj8fF1iPp5g@mail.gmail.com> (raw)
In-Reply-To: <20191023171611.qfcwfce2roe3k3qw@pali>

On Wed, Oct 23, 2019 at 7:16 PM Pali Rohár <pali.rohar@gmail.com> wrote:
> On Wednesday 23 October 2019 16:21:19 Chris Murphy wrote:
> > On Wed, Oct 23, 2019 at 1:50 PM Pali Rohár <pali.rohar@gmail.com> wrote:
> > > I do not think that kernel guarantee for any filesystem that rename
> > > operation would be atomic on underlying disk storage.
> > >
> > > But somebody else should confirm it.
> >
> > I don't know either or how to confirm it.
>
> Somebody who is watching linuxfs-devel and has deep knowledge in this
> area... could provide more information.

This is filesystem specific.
For example on UBIFS we make sure that the rename operation is atomic.
Changing multiple directory entries is one journal commit, so either it happened
completely or not at all.
On JFFS2, on the other hand, rename can degrade to a hard link.

I'd go so far and claim that any modern Linux filesystem guarantees
that rename is atomic.
But bugs still happen, crashmonkey found some interesting issues in
this area[0].

[0] http://www.cs.utexas.edu/~vijay/papers/osdi18-crashmonkey.pdf

-- 
Thanks,
//richard

  parent reply	other threads:[~2019-10-23 21:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 19:57 Is rename(2) atomic on FAT? Chris Murphy
2019-10-21 21:44 ` Richard Weinberger
2019-10-22 10:54   ` Pali Rohár
2019-10-23  0:10     ` Chris Murphy
2019-10-23 11:50       ` Pali Rohár
2019-10-23 14:21         ` Chris Murphy
2019-10-23 17:16           ` Pali Rohár
2019-10-23 19:18             ` Chris Murphy
2019-10-23 21:21             ` Richard Weinberger [this message]
2019-10-23 21:56               ` Chris Murphy
2019-10-23 22:22                 ` Richard Weinberger
2019-10-24 21:46                   ` Chris Murphy
2019-10-24 21:57                     ` Pali Rohár
2019-10-24 22:19                       ` Chris Murphy
2019-10-24 22:16                     ` Richard Weinberger
2019-10-24 22:26                       ` Chris Murphy
2019-10-24 22:33                         ` Richard Weinberger
2019-10-25  9:22                           ` Chris Murphy
2019-10-25  9:50                             ` Richard Weinberger
2019-10-23 12:53       ` Colin Walters
2019-10-23 14:24         ` Chris Murphy
2019-10-23 17:26           ` Colin Walters

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFLxGvxCVNy0yj8SQmtOyk5xcmYag1rxe3v7GtbEj8fF1iPp5g@mail.gmail.com \
    --to=richard.weinberger@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=pali.rohar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.