From unknown Tue Aug 19 10:01:02 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8091 <8091@debbugs.gnu.org> To: bug#8091 <8091@debbugs.gnu.org> Subject: Status: fiemap_capable_ misbehaves in a chroot Reply-To: bug#8091 <8091@debbugs.gnu.org> Date: Tue, 19 Aug 2025 17:01:02 +0000 retitle 8091 fiemap_capable_ misbehaves in a chroot reassign 8091 coreutils submitter 8091 Adam Sampson severity 8091 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 21 09:34:39 2011 Received: (at submit) by debbugs.gnu.org; 21 Feb 2011 14:34:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrWqT-0005I9-S2 for submit@debbugs.gnu.org; Mon, 21 Feb 2011 09:34:39 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrVgD-0003eP-57 for submit@debbugs.gnu.org; Mon, 21 Feb 2011 08:19:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrVg5-0005Xe-4N for submit@debbugs.gnu.org; Mon, 21 Feb 2011 08:19:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:42594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrVg4-0005Te-U7 for submit@debbugs.gnu.org; Mon, 21 Feb 2011 08:19:49 -0500 Received: from [140.186.70.92] (port=57873 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrVRn-0004VC-2p for bug-coreutils@gnu.org; Mon, 21 Feb 2011 08:05:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrVRm-0002S6-79 for bug-coreutils@gnu.org; Mon, 21 Feb 2011 08:05:03 -0500 Received: from malt.us-lot.org ([78.31.108.14]:44877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrVRm-0002QJ-2c for bug-coreutils@gnu.org; Mon, 21 Feb 2011 08:05:02 -0500 Received: from 94-194-126-16.zone8.bethere.co.uk ([94.194.126.16] helo=cartman.offog.org) by malt.us-lot.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1PrVRd-0001TD-85 for bug-coreutils@gnu.org; Mon, 21 Feb 2011 13:04:53 +0000 Received: from ats by cartman.offog.org with local (Exim 4.72) (envelope-from ) id 1PrVRh-0003Oo-VA for bug-coreutils@gnu.org; Mon, 21 Feb 2011 13:04:58 +0000 Date: Mon, 21 Feb 2011 13:04:57 +0000 From: Adam Sampson To: bug-coreutils@gnu.org Subject: fiemap_capable_ misbehaves in a chroot Message-ID: <20110221130457.GM3371@cartman.at.offog.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Homepage: http://offog.org/ User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 21 Feb 2011 09:34:36 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Hi, A minor bug in the testsuite in coreutils 8.10... I package software in a chroot. At the moment, my chroot doesn't contain an mtab file, which means df can't tell what type the filesystem is: $ df -T / Filesystem Type 1K-blocks Used Available Use% Mounted on - - 288370908 90872412 194568804 32% / The fiemap_capable_ function in tests/init.cfg uses df to tell whether the filesystem it's running on supports fiemap, by asking it to only list filesystems that it knows are fiemap-capable using -t. However, the selected_fstype function in df.c will always include filesystems that it doesn't know the type of, even when -t is specified: $ df -T -t blahfs / Filesystem Type 1K-blocks Used Available Use% Mounted on - - 288370908 90872400 194568816 32% / The result is that fiemap_capable_ assumes my chrooted filesystem supports fiemap when it doesn't, so the tests that use it fail. I'm not sure at this point whether df -t is doing the wrong thing or fiemap_capable_ is using it incorrectly. Any thoughts? Thanks very much, -- Adam Sampson From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 21 10:20:22 2011 Received: (at 8091-done) by debbugs.gnu.org; 21 Feb 2011 15:20:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrXYj-0006LF-T2 for submit@debbugs.gnu.org; Mon, 21 Feb 2011 10:20:22 -0500 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PrXYh-0006L2-BR for 8091-done@debbugs.gnu.org; Mon, 21 Feb 2011 10:20:20 -0500 Received: (qmail 59958 invoked from network); 21 Feb 2011 15:20:13 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 21 Feb 2011 15:20:13 -0000 Message-ID: <4D6281CC.1050106@draigBrady.com> Date: Mon, 21 Feb 2011 15:16:28 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Adam Sampson Subject: Re: bug#8091: fiemap_capable_ misbehaves in a chroot References: <20110221130457.GM3371@cartman.at.offog.org> In-Reply-To: <20110221130457.GM3371@cartman.at.offog.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8091-done Cc: 8091-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 21/02/11 13:04, Adam Sampson wrote: > Hi, > > A minor bug in the testsuite in coreutils 8.10... > > I package software in a chroot. At the moment, my chroot doesn't contain > an mtab file, which means df can't tell what type the filesystem is: Going forward /etc/mtab is going to be linked to /proc/mounts so this should be less of an issue. > > $ df -T / > Filesystem Type 1K-blocks Used Available Use% Mounted on > - - 288370908 90872412 194568804 32% / > > The fiemap_capable_ function in tests/init.cfg uses df to tell whether > the filesystem it's running on supports fiemap, by asking it to only > list filesystems that it knows are fiemap-capable using -t. However, the > selected_fstype function in df.c will always include filesystems that it > doesn't know the type of, even when -t is specified: > > $ df -T -t blahfs / > Filesystem Type 1K-blocks Used Available Use% Mounted on > - - 288370908 90872400 194568816 32% / > > The result is that fiemap_capable_ assumes my chrooted filesystem > supports fiemap when it doesn't, so the tests that use it fail. That is already addressed with: http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=5c3fd50a > I'm not sure at this point whether df -t is doing the wrong thing or > fiemap_capable_ is using it incorrectly. Any thoughts? We may adjust what df does in future when it can't get the fs list. Perhaps we could resort to statfs(), though that has its own ambiguities, like ext[234] all having the same type. Hmm, that reminds me that we probably want to: diff --git a/src/stat.c b/src/stat.c index f26dced..5458e48 100644 --- a/src/stat.c +++ b/src/stat.c @@ -273,7 +273,7 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) case S_MAGIC_EXT: /* 0x137D */ return "ext"; case S_MAGIC_EXT2: /* 0xEF53 */ - return "ext2/ext3"; + return "ext2/ext3/ext4"; case S_MAGIC_EXT2_OLD: /* 0xEF51 */ return "ext2"; case S_MAGIC_FAT: /* 0x4006 */ cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 21 11:25:30 2011 Received: (at 8091) by debbugs.gnu.org; 21 Feb 2011 16:25:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrYZl-0007nr-OI for submit@debbugs.gnu.org; Mon, 21 Feb 2011 11:25:30 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrYZj-0007ng-VZ for 8091@debbugs.gnu.org; Mon, 21 Feb 2011 11:25:28 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 4C24A600CD; Mon, 21 Feb 2011 17:25:22 +0100 (CET) From: Jim Meyering To: 8091@debbugs.gnu.org Subject: Re: bug#8091: fiemap_capable_ misbehaves in a chroot In-Reply-To: <4D6281CC.1050106@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?= =?iso-8859-1?Q?g?= Brady"'s message of "Mon, 21 Feb 2011 15:16:28 +0000") References: <20110221130457.GM3371@cartman.at.offog.org> <4D6281CC.1050106@draigBrady.com> Date: Mon, 21 Feb 2011 17:25:22 +0100 Message-ID: <87hbbxe4nh.fsf@rho.meyering.net> Lines: 34 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8091 Cc: P@draigBrady.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) P=E1draig Brady wrote: ... >> I'm not sure at this point whether df -t is doing the wrong thing or >> fiemap_capable_ is using it incorrectly. Any thoughts? > > We may adjust what df does in future when it can't get the fs list. > Perhaps we could resort to statfs(), though that has its own > ambiguities, like ext[234] all having the same type. > Hmm, that reminds me that we probably want to: > > diff --git a/src/stat.c b/src/stat.c > index f26dced..5458e48 100644 > --- a/src/stat.c > +++ b/src/stat.c > @@ -273,7 +273,7 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) > case S_MAGIC_EXT: /* 0x137D */ > return "ext"; > case S_MAGIC_EXT2: /* 0xEF53 */ > - return "ext2/ext3"; > + return "ext2/ext3/ext4"; > case S_MAGIC_EXT2_OLD: /* 0xEF51 */ > return "ext2"; > case S_MAGIC_FAT: /* 0x4006 */ We talked about this two years ago: Re: [PATCH] stat: add support for more file system types http://www.mail-archive.com/bug-coreutils@gnu.org/msg18898.html Re: [Bug 485507] RFE: add ext4 to "stat -f" output http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00160.html I guess the question should be "do we ever want to change this?". If so, sooner may be better than later, but I'm not sure it's worth the risk. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 21 12:26:45 2011 Received: (at 8091) by debbugs.gnu.org; 21 Feb 2011 17:26:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrZX2-0000fv-MG for submit@debbugs.gnu.org; Mon, 21 Feb 2011 12:26:45 -0500 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PrZX0-0000fi-GT for 8091@debbugs.gnu.org; Mon, 21 Feb 2011 12:26:43 -0500 Received: (qmail 86002 invoked from network); 21 Feb 2011 17:26:35 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 21 Feb 2011 17:26:35 -0000 Message-ID: <4D629F6B.1020705@draigBrady.com> Date: Mon, 21 Feb 2011 17:22:51 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Jim Meyering Subject: Re: bug#8091: fiemap_capable_ misbehaves in a chroot References: <20110221130457.GM3371@cartman.at.offog.org> <4D6281CC.1050106@draigBrady.com> <87hbbxe4nh.fsf@rho.meyering.net> In-Reply-To: <87hbbxe4nh.fsf@rho.meyering.net> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8091 Cc: 8091@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 21/02/11 16:25, Jim Meyering wrote: > Pádraig Brady wrote: >> Hmm, that reminds me that we probably want to: >> >> diff --git a/src/stat.c b/src/stat.c >> index f26dced..5458e48 100644 >> --- a/src/stat.c >> +++ b/src/stat.c >> @@ -273,7 +273,7 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) >> case S_MAGIC_EXT: /* 0x137D */ >> return "ext"; >> case S_MAGIC_EXT2: /* 0xEF53 */ >> - return "ext2/ext3"; >> + return "ext2/ext3/ext4"; >> case S_MAGIC_EXT2_OLD: /* 0xEF51 */ >> return "ext2"; >> case S_MAGIC_FAT: /* 0x4006 */ > > We talked about this two years ago: > > Re: [PATCH] stat: add support for more file system types > http://www.mail-archive.com/bug-coreutils@gnu.org/msg18898.html > Re: [Bug 485507] RFE: add ext4 to "stat -f" output > http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00160.html > > I guess the question should be "do we ever want to change this?". > If so, sooner may be better than later, but I'm not sure it's worth > the risk. Hmm yes, this is debatable. So your argument is script might be keying on "ext2/ext3" rather than "ext2/ext3/*". Unlikely, but possible. It's a pity ext4 didn't pick a new ID, given that it's not forwards compatible when various features are used, unlike ext[23] where one could always mount as ext2. I guess it's safer to leave alone. cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 21 12:29:36 2011 Received: (at 8091-done) by debbugs.gnu.org; 21 Feb 2011 17:29:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrZZo-0000kL-GU for submit@debbugs.gnu.org; Mon, 21 Feb 2011 12:29:36 -0500 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrZZm-0000k9-Qo for 8091-done@debbugs.gnu.org; Mon, 21 Feb 2011 12:29:35 -0500 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 42CCA60162; Mon, 21 Feb 2011 18:29:29 +0100 (CET) From: Jim Meyering To: =?iso-8859-1?Q?P=E1draig?= Brady Subject: Re: bug#8091: fiemap_capable_ misbehaves in a chroot In-Reply-To: <4D629F6B.1020705@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?= =?iso-8859-1?Q?g?= Brady"'s message of "Mon, 21 Feb 2011 17:22:51 +0000") References: <20110221130457.GM3371@cartman.at.offog.org> <4D6281CC.1050106@draigBrady.com> <87hbbxe4nh.fsf@rho.meyering.net> <4D629F6B.1020705@draigBrady.com> Date: Mon, 21 Feb 2011 18:29:29 +0100 Message-ID: <87tyfxcn46.fsf@rho.meyering.net> Lines: 45 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: 8091-done Cc: 8091-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.8 (-----) P=E1draig Brady wrote: > On 21/02/11 16:25, Jim Meyering wrote: >> P=E1draig Brady wrote: >>> Hmm, that reminds me that we probably want to: >>> >>> diff --git a/src/stat.c b/src/stat.c >>> index f26dced..5458e48 100644 >>> --- a/src/stat.c >>> +++ b/src/stat.c >>> @@ -273,7 +273,7 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) >>> case S_MAGIC_EXT: /* 0x137D */ >>> return "ext"; >>> case S_MAGIC_EXT2: /* 0xEF53 */ >>> - return "ext2/ext3"; >>> + return "ext2/ext3/ext4"; >>> case S_MAGIC_EXT2_OLD: /* 0xEF51 */ >>> return "ext2"; >>> case S_MAGIC_FAT: /* 0x4006 */ >> >> We talked about this two years ago: >> >> Re: [PATCH] stat: add support for more file system types >> http://www.mail-archive.com/bug-coreutils@gnu.org/msg18898.html >> Re: [Bug 485507] RFE: add ext4 to "stat -f" output >> http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00160.html >> >> I guess the question should be "do we ever want to change this?". >> If so, sooner may be better than later, but I'm not sure it's worth >> the risk. > > Hmm yes, this is debatable. > > So your argument is script might be keying on "ext2/ext3" > rather than "ext2/ext3/*". Unlikely, but possible. Right, but "ext2/ext3*". > It's a pity ext4 didn't pick a new ID, given that > it's not forwards compatible when various features are used, > unlike ext[23] where one could always mount as ext2. > > I guess it's safer to leave alone. So I'm closing the ticket. From unknown Tue Aug 19 10:01:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 22 Mar 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator