All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-kernel@vger.kernel.org
Subject: d_path() and overlay fs
Date: Fri, 20 Mar 2015 14:29:14 +0100	[thread overview]
Message-ID: <20150320132914.GA1749@ws.net.home> (raw)


 Hi,

 kernel-4.0.0-0.rc4.git1.3.fc23 (I have nothing more recent right now,
 sorry it the problem is already fixed).
 
 It seems like d_path() kernel function returns nonsenses for overlay fs.

 Example:

   # mount -t overlay overlay -olowerdir=/mnt/low,upperdir=/mnt/up/data,workdir=/mnt/up/work /mnt/merged
   # dd if=/dev/zero of=/mnt/merged/image count=1 bs=1MiB

   # losetup -f /mnt/merged/image

   # cat /sys/block/loop0/loop/backing_file 
   /image


 ...should be /mnt/merged/image.

 drivers/block/loop.c: loop_attr_backing_file_show() uses d_path()

 It seems like serious problem because kernel uses d_path() (and
 friends) on many places to generate path strings for userspace in
 /proc and /sys and people already use overlay fs in containers.
 
 Another example:
 
   # cat /proc/swaps 
   Filename               Type        Size    Used    Priority
   /dev/sda6              partition   8191996 258308  -1
   /image                 file        1020    0       -2


    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

             reply	other threads:[~2015-03-20 13:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 13:29 Karel Zak [this message]
2015-03-20 13:31 ` d_path() and overlay fs Al Viro
2015-03-20 13:41 ` Josh Boyer
2015-03-20 16:01   ` Miklos Szeredi
2015-03-20 16:25     ` Al Viro
2015-03-20 16:53       ` Miklos Szeredi
2015-03-20 18:16         ` Miklos Szeredi
2016-01-06  5:26 ` sangeetha Busangari

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=20150320132914.GA1749@ws.net.home \
    --to=kzak@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.