linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	kernel-team@fb.com
Subject: Re: [PATCH 0/3] Btrfs: stop abusing current->journal_info for direct I/O
Date: Fri, 11 May 2018 10:28:29 -0700	[thread overview]
Message-ID: <20180511172829.GC29366@vader> (raw)
In-Reply-To: <16e0b655-3778-990d-2cb9-abf34ea9e3ad@suse.com>

On Fri, May 11, 2018 at 12:53:36PM +0300, Nikolay Borisov wrote:
> 
> 
> On 11.05.2018 09:30, Omar Sandoval wrote:
> > From: Omar Sandoval <osandov@fb.com>
> > 
> > Hi, everyone,
> > 
> > Btrfs currently abuses current->journal_info in btrfs_direct_IO() in
> > order to pass around some state to get_block() and submit_io(). This
> > hack is ugly and unnecessary because the data we pass around is only
> > used in one call frame. Robbie Ko also pointed out [1] that it could
> > potentially cause a crash if we happen to end up in start_transaction()
> > (e.g., from memory reclaim calling into btrfs_evict_inode(), which can
> > start a transaction). I'm not convinced that Robbie's case can happen in
> > practice since we are using GFP_NOFS for allocations during direct I/O,
> > but either way it's fragile and nasty.
> 
> When I worked initially on btrfs-over-swap I managed to hit a case where
> ext4 stacked on top of btrfs would crash since btrfs will overwrite
> journal_info which was set by ext4. So this change is indeed welcome :)

Yup, that's what I originally made these patches for. Although my latest
idea for swap is to do something along the lines of Darrick's
iomap_swap_activate(): https://patchwork.kernel.org/patch/10376435/,
I'll be getting back to that soon.

      parent reply	other threads:[~2018-05-11 17:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11  6:30 [PATCH 0/3] Btrfs: stop abusing current->journal_info for direct I/O Omar Sandoval
2018-05-11  6:30 ` [PATCH 1/3] fs: add initial bh_result->b_private value to __blockdev_direct_IO() Omar Sandoval
2018-05-11 20:05   ` Al Viro
2018-05-11 20:30     ` Omar Sandoval
2018-05-11 20:32       ` Al Viro
2018-05-11 20:41         ` Omar Sandoval
2018-05-14 16:35       ` David Sterba
2018-06-25 17:16         ` David Sterba
2018-06-29  7:02           ` Omar Sandoval
2018-05-11  6:30 ` [PATCH 2/3] fs: add private argument to dio_submit_t Omar Sandoval
2018-05-11  6:30 ` [PATCH 3/3] Btrfs: stop abusing current->journal_info in btrfs_direct_IO() Omar Sandoval
2018-05-11  9:26 ` [PATCH 0/3] Btrfs: stop abusing current->journal_info for direct I/O David Sterba
2018-05-11  9:53 ` Nikolay Borisov
2018-05-11 10:24   ` David Sterba
2018-05-11 17:28   ` Omar Sandoval [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=20180511172829.GC29366@vader \
    --to=osandov@osandov.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=nborisov@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).