From: Hugo Mills <hugo-lkml@carfax.org.uk>
To: Nick Krause <xerofoify@gmail.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
"linux-btrfs@vger.kernel.org SYSTEM list:BTRFS FILE"
<linux-btrfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Add support to check for FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_ZERO_RANGE crap modes
Date: Fri, 1 Aug 2014 10:26:24 +0100 [thread overview]
Message-ID: <20140801092624.GS31950@carfax.org.uk> (raw)
In-Reply-To: <CAPDOMVj8cEsgR1TTOkTUWaxMHiEbpnM6qcj7opRuRLP+3YOfTg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2316 bytes --]
On Thu, Jul 31, 2014 at 09:53:15PM -0400, Nick Krause wrote:
> On Thu, Jul 31, 2014 at 3:09 PM, Hugo Mills <hugo@carfax.org.uk> wrote:
> > On Thu, Jul 31, 2014 at 01:53:33PM -0400, Nicholas Krause wrote:
> >> This adds checks for the stated modes as if they are crap we will return error
> >> not supported.
> >
> > You've just enabled two options, but you haven't actually
> > implemented the code behind it. I would tell you *NOT* to do anything
> > else on this work until you can answer the question: What happens if
> > you apply this patch, create a large file called "foo.txt", and then a
> > userspace program executes the following code?
> >
> > int fd = open("foo.txt", O_RDWR);
> > fallocate(fd, FALLOCATE_FL_COLLAPSE_RANGE, 50, 50);
> >
> > Try it on a btrfs filesystem, both with and without your patch.
> > Also try it on an ext4 filesystem.
> >
> > Once you've done all of that, reply to this mail and tell me what
> > the problem is with this patch. You need to make two answers: what are
> > the technical problems with the patch? What errors have you made in
> > the development process?
> >
> > *Only* if you can answer those questions sensibly, should you write
> > any more patches, of any kind.
[snip]
> Calls are there in btrfs , therefore will either kernel panic or
> cause an oops.
That's a guess. I can tell it's a guess, because I've actually read
(some of) the rest of that function, so I've got a good idea of what I
think it will do -- and panic or oops is not the answer. Try again.
You can answer this question two ways: by test (see my suggestion
above), or by reading and understanding the code. Either will work in
this case, but doing neither is not an option for someone who wants to
change the function.
> Need to test this patch as this is very easy to catch bug.
So why didn't you? It's your patch, testing it is your job --
*before* it gets out into the outside world.
Hugo.
--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- But people have always eaten people, / what else is there to ---
eat? / If the Juju had meant us not to eat people / he
wouldn't have made us of meat.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next prev parent reply other threads:[~2014-08-01 9:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 17:53 [PATCH] Add support to check for FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_ZERO_RANGE crap modes Nicholas Krause
2014-07-31 19:09 ` Hugo Mills
2014-08-01 1:53 ` Nick Krause
2014-08-01 9:26 ` Hugo Mills [this message]
2014-08-01 12:21 ` Theodore Ts'o
2014-08-01 16:07 ` Nick Krause
2014-08-01 1:49 ` Duncan
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=20140801092624.GS31950@carfax.org.uk \
--to=hugo-lkml@carfax.org.uk \
--cc=clm@fb.com \
--cc=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xerofoify@gmail.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