All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
	"linux-unionfs@vger.kernel.org" <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH 3/4] Overlayfs: Wrap accesses to ->d_inode on subordinate filesystems
Date: Fri, 17 Apr 2015 10:53:46 +0200	[thread overview]
Message-ID: <CAJfpegta6LDU+pVDA1ShcdxTpMmkGuFz7-dbJ7YiuJs9opwkuQ@mail.gmail.com> (raw)
In-Reply-To: <20150416144309.12620.38093.stgit@warthog.procyon.org.uk>

On Thu, Apr 16, 2015 at 4:43 PM, David Howells <dhowells@redhat.com> wrote:
> Convert ->d_inode to d_backing_inode() or d_is_xxx() when it is being used to
> access an inode on a subordinate filesystem of an overlay - even if that
> subordinate is itself an overlay.

Why?

What if foo is on another overlay and there's a copy-up between
mutex_lock(d_backing_inode(foo)) and
mutex_unlock(d_backing_inode(foo))? Copy-up is currently not
serialized on lower inode's i_mutex in overlayfs, and I don't see why
it would need to be.

To be honest, I find any use of d_backing_inode() outside of LSM's
highly dubious.  And each of those need would need careful scrutiny.

Why not start out simple and switch everything mindlessly to d_inode(), etc?

Then add the infrastructure for d_backing_inode() to make it actually
work, and e.g. convert selinux to use it.   Keeping everything else
unconverted will result in much less likelihood of something
accidentally breaking, like the above.

Thanks,
Miklos

  reply	other threads:[~2015-04-17  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16 14:42 [PATCH 0/4] Overlayfs: Wrap ->d_inode David Howells
2015-04-16 14:42 ` [PATCH 1/4] Overlayfs: Convert S_ISDIR(dentry->d_inode) to d_is_dir()/d_can_lookup() David Howells
2015-04-16 14:43 ` [PATCH 2/4] Overlayfs: Convert own ->d_inode to d_inode() or d_really_is_positive/negative() David Howells
2015-04-16 14:43 ` [PATCH 3/4] Overlayfs: Wrap accesses to ->d_inode on subordinate filesystems David Howells
2015-04-17  8:53   ` Miklos Szeredi [this message]
2015-04-16 14:43 ` [PATCH 4/4] Overlayfs: Wrap RCU-mode " David Howells

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=CAJfpegta6LDU+pVDA1ShcdxTpMmkGuFz7-dbJ7YiuJs9opwkuQ@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --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.