linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: dsterba@suse.cz, Qu Wenruo <quwenruo@cn.fujitsu.com>,
	Qu Wenruo <quwenruo.btrfs@gmx.com>,
	Abhay Sachan <lkp.abhay@gmail.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: Btrfs progs build fails for 4.8
Date: Fri, 14 Oct 2016 12:00:56 -0500	[thread overview]
Message-ID: <3caf7539-5eae-d085-1fc6-b48ce0ae99a2@redhat.com> (raw)
In-Reply-To: <20161014154942.GB11398@twin.jikos.cz>

On 10/14/16 10:49 AM, David Sterba wrote:
> On Thu, Oct 13, 2016 at 03:25:57PM +0800, Qu Wenruo wrote:
>> At 10/13/2016 01:26 AM, David Sterba wrote:
>>> On Wed, Oct 12, 2016 at 10:01:27PM +0800, Qu Wenruo wrote:
>>>>
>>>>
>>>> On 10/12/2016 09:58 PM, Abhay Sachan wrote:
>>>>> Hi,
>>>>> I tried building latest btrfs progs on CentOS 6, "./configure" failed
>>>>> with the error:
>>>>>
>>>>> checking for FIEMAP_EXTENT_SHARED defined in linux/fiemap.h... no
>>>>> configure: error: no definition of FIEMAP_EXTENT_SHARED found
>>>>>
>>>>> Any ideas what am I lacking in the system?
>>>>
>>>> Your kernel is too old and its header doesn't support
>>>> FIEMAP_EXTENT_SHARED flag for fiemap ioctl.
>>>
>>> As this is not the first time, I wonder if we could provide a defintion
>>> of the macro in progs, regardless of the installed headers. Note that
>>> this does not mean the running kernel is old. Previously the user said
>>> he was running a 4.4 kernel [1] (or it could be any other kernel
>>> version). For that combination of headers and running kernel, I think
>>> it's ok to add a fallback definition.
>>
>> Yes, fallback definition is good for case like running kernel supports 
>> SHARED_EXTENT flag, but not kernel header.
>>
>> But I'm a little concerned about such fallback definition will lead to 
>> corrupted result for "fi du".
> 
> Well, not corrupted bug wrong. The shared data will be reported as
> exclusive.
> 
>>>> And since that flag is very important for tools like "btrfs filesystem
>>>> du", for old kernel doesn't support EXTENT_SHARED flag, we have no
>>>> choice but abort configuration.
>>>
>>> The check was added to configure so it's caught earlier than during
>>> build. The 'fi du' command is useful, but not IMO critical to stop the
>>> build.
>>
>> What about just disabling subcommands using SHARED_EXTENT flag?
>> Like "fi du".
> 
> This would need to be checked at runtime, based only on kernel version.
> I think we can do that, print a warning in 'fi du' but otherwise let it
> continue.

Checking kernel version is pretty unreliable - distro kernels that backport
will quite possibly fail the version test.  Sure, it's possible to patch
the check back out of userspace in the distro, but one must first know that
such things exist, and look out for them...

Maybe warn on kernel version < 2.6.33 /and/ no shared extents found.

Or, why not just:

1) #ifndef FIEMAP_EXTENT_SHARED / #define FIEMAP_EXTENT_SHARED 0x00002000 / #endif
2) carry on as usual.

Worst case is that you don't get shared accounting on very old kernels.

And FIEMAP_EXTENT_SHARED has been around since 2.6.33 so it's not going
to bite too many people, right?

(If you really wanted to, you could export has_fiemap_shared in the btrfs
features sysfs file, and runtime could see if shared extents are
detectable and if not, print a warning or something ... but given that
this would be a new feature much newer than the fiemap flag I'm not
sure that would do much good.)

-Eric
 


  reply	other threads:[~2016-10-14 17:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-12 13:58 Btrfs progs build fails for 4.8 Abhay Sachan
2016-10-12 14:01 ` Qu Wenruo
2016-10-12 14:45   ` Abhay Sachan
2016-10-12 14:54     ` Eric Sandeen
2016-10-12 17:26   ` David Sterba
2016-10-13  7:25     ` Qu Wenruo
2016-10-14 15:49       ` David Sterba
2016-10-14 17:00         ` Eric Sandeen [this message]
2016-10-14 17:03           ` [PATCH] btrfs-progs: define FIEMAP_EXTENT_SHARED locally if needed Eric Sandeen
2016-10-14 17:08           ` Btrfs progs build fails for 4.8 David Sterba
2016-10-14 16:54 ` 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=3caf7539-5eae-d085-1fc6-b48ce0ae99a2@redhat.com \
    --to=sandeen@redhat.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lkp.abhay@gmail.com \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=quwenruo@cn.fujitsu.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).