All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyfox@gentoo.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: Chris Mason <chris.mason@oracle.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/9] some fixes for bugs spotted by valgrind
Date: Fri, 3 Jun 2011 00:13:25 +0300	[thread overview]
Message-ID: <20110603001325.4a64b7c3@sf> (raw)
In-Reply-To: <m262oot2bw.fsf@firstfloor.org>

[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]

On Thu, 02 Jun 2011 13:17:55 -0700
Andi Kleen <andi@firstfloor.org> wrote:

> Sergei Trofimovich <slyfox@gentoo.org> writes:
> >
> > Am I too paranoid about the issue?
> 
> It sounds weird, because if the kernel would really checksum
> mutexes on disk you would have a lot of on disk
> format incompatibility between different kernel versions
> (e.g. between lockdep and normal kernels or kernels
> running on different architectures)
>
> If it would really happen (no opinion on that) it would
> be a serious bug.

Oh, I don't think things are so bad.

In order it to be a problem superblock loading would have to
be loaded exactly the same way as it's stored, but it isn't.
At least super copies (baked into btrfs_fs_info) are read
to separate data block (buffer_hear) and then copied properly
(in open_ctree) to super_copy/super_for_commit:

        bh = btrfs_read_dev_super(fs_devices->latest_bdev);
        if (!bh) {
                err = -EINVAL;
                goto fail_alloc;
        }

        memcpy(&fs_info->super_copy, bh->b_data, sizeof(fs_info->super_copy));
        memcpy(&fs_info->super_for_commit, &fs_info->super_copy,
               sizeof(fs_info->super_for_commit));
        brelse(bh);

But the way superblocks are written look racy.

-- 

  Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-06-02 21:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-30 21:18 [PATCH 0/9] some fixes for bugs spotted by valgrind Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 1/9] btrfs progs: fix extra metadata chunk allocation in --mixed case Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 2/9] btrfs-convert: fix typo: 'all inode' -> 'all inodes' Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 3/9] mkfs.btrfs: fail on scandir error (-r mode) Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 4/9] mkfs.btrfs: return some defined value instead of garbage when lookup checksum Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 5/9] mkfs.btrfs: fix symlink names writing Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 6/9] mkfs.btrfs: write zeroes instead on uninitialized data Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 7/9] mkfs.btrfs: free buffers allocated by pretty_sizes Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 8/9] mkfs.btrfs: fix memory leak caused by 'scandir()' calls Sergei Trofimovich
2011-05-30 21:19 ` [PATCH 9/9] mkfs.btrfs: fix error text in '-r' mode Sergei Trofimovich
2011-05-31 19:10 ` [PATCH 0/9] some fixes for bugs spotted by valgrind Sergei Trofimovich
2011-06-02 20:17   ` Andi Kleen
2011-06-02 21:13     ` Sergei Trofimovich [this message]
2011-06-02 23:26       ` Andi Kleen

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=20110603001325.4a64b7c3@sf \
    --to=slyfox@gentoo.org \
    --cc=andi@firstfloor.org \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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.