linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Race condition in btrfs_releasepage?
Date: Sun, 26 Oct 2014 11:07:24 -0700	[thread overview]
Message-ID: <20141026180724.GA16926@mew.home.network> (raw)

So I may be completely wrong here and someone might come in and tell me why
this doesn't matter, but I'm just trying to understand the BTRFS code and I
came across something that confused me.

try_release_extent_mapping appears to access page->mapping->host->i_size
without any sort of serialization. It's used in the implementation of
btrfs_releasepage, and aops->releasepage, as far as I can tell, isn't called
with any locks held. Should we be grabbing i_mutex or using i_size_read here
instead? I'm not too familiar with the locking rules for inodes or releasepage.

Thanks!
-- 
Omar

                 reply	other threads:[~2014-10-26 18:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20141026180724.GA16926@mew.home.network \
    --to=osandov@osandov.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@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 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).