All of lore.kernel.org
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@gmail.com>
To: Vijay Chidambaram <vvijay03@gmail.com>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>,
	Soujanya Ponnapalli <soujanyap95@gmail.com>,
	Jayashree Mohan <jayashree2912@gmail.com>,
	linux-xfs@vger.kernel.org, Dave Chinner <david@fromorbit.com>
Subject: Re: Strange behavior (possible bugs) in btrfs
Date: Wed, 23 May 2018 11:44:14 +0100	[thread overview]
Message-ID: <CAL3q7H7n9cTZyhdbvfLUXZ7u7W7ed5FLXBQBEQyTE9SrUWK3tw@mail.gmail.com> (raw)
In-Reply-To: <CAPaz=E+=aVagu2g3ZUiD-SjvnAAU0zb0SSaPKUitHT9CWuKW8A@mail.gmail.com>

On Mon, Apr 30, 2018 at 5:04 PM, Vijay Chidambaram <vvijay03@gmail.com> wrote:
> Hi,
>
> We found two more cases where the btrfs behavior is a little strange.
> In one case, an fsync-ed file goes missing after a crash. In the
> other, a renamed file shows up in both directories after a crash.
>
> Workload 1:
>
> mkdir A
> mkdir B
> mkdir A/C
> creat B/foo
> fsync B/foo
> link B/foo A/C/foo
> fsync A
> -- crash --
>
> Expected state after recovery:
> B B/foo A A/C exist

Why don't you expect A/C/foo as well? I would expect it to be persisted.
With xfs we don't get A/C/foo persisted, but it's persisted with ext4 and f2fs.

Adding xfs folks in cc to confirm the expected behaviour.

>
> What we find:
> Only B B/foo exist
>
> A is lost even after explicit fsync to A.
>
> Workload 2:
>
> mkdir A
> mkdir A/C
> rename A/C B
> touch B/bar
> fsync B/bar
> rename B/bar A/bar
> rename A B (replacing B with A at this point)
> fsync B/bar
> -- crash --
>
> Expected contents after recovery:
> A/bar
>
> What we find after recovery:
> A/bar
> B/bar
>
> We think this breaks rename's atomicity guarantee. bar should be
> present in either A or B, but now it is present in both.
>
> Thanks,
> Vijay
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”

      parent reply	other threads:[~2018-05-23 10:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 16:04 Strange behavior (possible bugs) in btrfs Vijay Chidambaram
2018-04-30 16:51 ` Jeff Mahoney
2018-04-30 16:56   ` Jayashree Mohan
2018-05-02 22:50     ` Vijay Chidambaram
2018-05-11 15:45 ` Filipe Manana
2018-08-28 20:35   ` Jayashree Mohan
2018-08-29  8:56     ` Filipe Manana
2018-05-23 10:44 ` Filipe Manana [this message]

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=CAL3q7H7n9cTZyhdbvfLUXZ7u7W7ed5FLXBQBEQyTE9SrUWK3tw@mail.gmail.com \
    --to=fdmanana@gmail.com \
    --cc=david@fromorbit.com \
    --cc=jayashree2912@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=soujanyap95@gmail.com \
    --cc=vvijay03@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.