LKML Archive on
help / color / mirror / Atom feed
From: Chris Samuel <>
To: Felix Blanke <>
Cc:, Hugo Mills <>,,
	Linux Kernel <>
Subject: LOOP_GET_STATUS(64) truncates pathnames to 64 chars (was Re: Bug in mkfs.btrfs?!)
Date: Tue, 25 Jan 2011 11:15:11 +1100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20110124130104.GA7354@scooter>

 * CC'd to linux-kernel in case they have any feedback on this.
 * Long thread, trying to work out why mkfs.btrfs failed to
 * make a filesystem on an encrypted loopback mount called
 * /dev/loop2. Cause turned out to be mkfs.btrfs calling
 * LOOP_GET_STATUS to find out if the block device was mounted
 * and getting a truncated device name back and so it later
 * fails when lstat() is called on the truncated device path.
 * The long device name for the encrypted loopback mount was
 * because /dev/disk/by-id/$ID was used when Felix created it
 * to cope with devices moving around.

On 25/01/11 00:01, Felix Blanke wrote:

> you were talking about the LOOP_GET_STATUS function. I'm not
> quite sure where does it came from. Is it part of the kernel?
> Or does it come from the util-linux package?

It's in the kernel, and there is both LOOP_GET_STATUS (old
implementation) and LOOP_GET_STATUS64 (new implementation).

They return structures called loop_info and loop_info64
respectively and both are defined in include/linux/loop.h .

Sadly in both cases the lengths of paths are defined to be
LO_NAME_SIZE which is currently 64 and hence either
implementation will cause the problematic:

0x7fffa30b3cf0) = -1 ENOENT (No such file or directory)

I've CC'd this to the LKML in case they have any feedback on
this apparent problem with the API.

 Chris Samuel  :  :  Melbourne, VIC

       reply	other threads:[~2011-01-25  0:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110122144513.GA2539@scooter>
     [not found] ` <20110122145222.GB2539@scooter>
     [not found]   ` <>
     [not found]     ` <20110122155612.GA3664@scooter>
     [not found]       ` <>
     [not found]         ` <>
     [not found]           ` <20110124130104.GA7354@scooter>
2011-01-25  0:15             ` Chris Samuel [this message]
2011-02-10 12:29               ` Petr Uzel
2011-02-11 13:04                 ` Felix Blanke
2011-02-11 18:59                   ` Milan Broz
     [not found]                     ` <>
2011-02-11 19:31                       ` Milan Broz
2011-02-11 19:41                         ` Felix Blanke

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='LOOP_GET_STATUS(64) truncates pathnames to 64 chars (was Re: Bug in mkfs.btrfs?'\!')' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).