All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Christoph Hellwig <hch@lst.de>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: improve type safety by passing struct btrfs_bio around
Date: Fri, 3 Mar 2023 15:27:46 +0100	[thread overview]
Message-ID: <20230303142746.GC32738@lst.de> (raw)
In-Reply-To: <a0d08906-acb2-d5b4-9585-d43faf05227a@gmx.com>

On Fri, Mar 03, 2023 at 07:34:08AM +0800, Qu Wenruo wrote:
> But I'm still a little concerned about possible rogue non-btrfs bios.
> Is it possible to add one magic number member for btrfs_bio, and do extra 
> magic number check in btrfs_bio() macro?

A magic number adds runtime overhead.  The container_of on the bio
frontpad is very common all over the kernel, and we don't do that
anywhere else.  After this series the btrfs_bio() only really happens
on allocation and the end_io handler which is fairly easy to keep
straight.


      reply	other threads:[~2023-03-03 14:28 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 13:42 improve type safety by passing struct btrfs_bio around Christoph Hellwig
2023-03-01 13:42 ` [PATCH 01/10] btrfs: remove unused members from struct btrfs_encoded_read_private Christoph Hellwig
2023-03-02 12:10   ` Johannes Thumshirn
2023-03-02 23:19   ` Qu Wenruo
2023-03-03  9:14   ` Anand Jain
2023-03-01 13:42 ` [PATCH 02/10] btrfs: cleanup btrfs_encoded_read_regular_fill_pages Christoph Hellwig
2023-03-02 12:15   ` Johannes Thumshirn
2023-03-02 23:24   ` Qu Wenruo
2023-03-03 14:24     ` Christoph Hellwig
2023-03-03  9:14   ` Anand Jain
2023-03-01 13:42 ` [PATCH 03/10] btrfs: move zero filling of compressed read bios into common code Christoph Hellwig
2023-03-02 12:17   ` Johannes Thumshirn
2023-03-02 23:25   ` Qu Wenruo
2023-03-03  9:15   ` Anand Jain
2023-03-01 13:42 ` [PATCH 04/10] btrfs: pass a btrfs_bio to btrfs_submit_bio Christoph Hellwig
2023-03-02 12:19   ` Johannes Thumshirn
2023-03-02 23:26   ` Qu Wenruo
2023-03-03  9:15   ` Anand Jain
2023-03-01 13:42 ` [PATCH 05/10] btrfs: pass a btrfs_bio to btrfs_submit_compressed_read Christoph Hellwig
2023-03-02 13:00   ` Johannes Thumshirn
2023-03-02 23:27   ` Qu Wenruo
2023-03-03  9:15   ` Anand Jain
2023-03-01 13:42 ` [PATCH 06/10] btrfs: store a pointer to the original btrfs_bio in struct compressed_bio Christoph Hellwig
2023-03-02 13:01   ` Johannes Thumshirn
2023-03-02 23:28   ` Qu Wenruo
2023-03-03  9:16   ` Anand Jain
2023-03-01 13:42 ` [PATCH 07/10] btrfs: simplify finding the inode in submit_one_bio Christoph Hellwig
2023-03-02 13:10   ` Johannes Thumshirn
2023-03-02 23:30   ` Qu Wenruo
2023-03-03  9:16   ` Anand Jain
2023-03-01 13:42 ` [PATCH 08/10] btrfs: store a pointer to a btrfs_bio in struct btrfs_bio_ctrl Christoph Hellwig
2023-03-02 14:20   ` Johannes Thumshirn
2023-03-03 14:25     ` Christoph Hellwig
2023-03-02 23:31   ` Qu Wenruo
2023-03-03  9:16   ` Anand Jain
2023-03-01 13:42 ` [PATCH 09/10] btrfs: return a btrfs_bio from btrfs_bio_alloc Christoph Hellwig
2023-03-02 14:22   ` Johannes Thumshirn
2023-03-02 23:31   ` Qu Wenruo
2023-03-03 22:48   ` Anand Jain
2023-03-04  3:38     ` Anand Jain
2023-03-06 16:57     ` Christoph Hellwig
2023-03-01 13:42 ` [PATCH 10/10] btrfs: make btrfs_split_bio work on struct btrfs_bio Christoph Hellwig
2023-03-02 14:25   ` Johannes Thumshirn
2023-03-02 23:32   ` Qu Wenruo
2023-03-03 23:13   ` Anand Jain
2023-03-02 23:34 ` improve type safety by passing struct btrfs_bio around Qu Wenruo
2023-03-03 14:27   ` Christoph Hellwig [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=20230303142746.GC32738@lst.de \
    --to=hch@lst.de \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.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.