linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.com, Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH v2 0/2] Ensure size values are rounded down
Date: Fri, 16 Jun 2017 14:39:18 +0300	[thread overview]
Message-ID: <1497613160-3074-1-git-send-email-nborisov@suse.com> (raw)

Hello, 

Here is a small series which fixes an issue that got reported internally to 
Suse and which affects devices whose size is not multiple of sectorsize. More
information can be found in the changelog for patch 2

The first patch in the series re-implements the btrfs_device_total_bytes
getter/setters manually so that we can add a WARN_ON to catch future offenders. 
I haven't implemented all 4 function that the macros do since we only ever use
the getter and setter. 

The second patch ensures that all the values passed to the setter are rounded 
down to a multiple of sectorsize. I also have an xfstest patch which passes
after this series is applied. 

Changes since v1: 
 * Moved some of the text from previous cover letter, into patch 2 to make 
 explanation of the bug more coherent. 
 * The first patch now only implements getter/setter while the 2nd patch 
 adds the WARN_ON 

Nikolay Borisov (2):
  btrfs: Manually implement device_total_bytes getter/setter
  btrfs: Round down values which are written for total_bytes_size

 fs/btrfs/ctree.h   | 21 ++++++++++++++++++++-
 fs/btrfs/volumes.c | 18 +++++++++++++-----
 2 files changed, 33 insertions(+), 6 deletions(-)

-- 
2.7.4


             reply	other threads:[~2017-06-16 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 11:39 Nikolay Borisov [this message]
2017-06-16 11:39 ` [PATCH v2 1/2] btrfs: Manually implement device_total_bytes getter/setter Nikolay Borisov
2017-06-16 11:39 ` [PATCH v2 2/2] btrfs: Round down values which are written for total_bytes_size Nikolay Borisov
2017-06-18  3:09   ` Duncan
2017-06-19 16:34 ` [PATCH v2 0/2] Ensure size values are rounded down David Sterba

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=1497613160-3074-1-git-send-email-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.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 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).