All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] fscrypt: cache decrypted symlink target in ->i_link
Date: Wed, 10 Apr 2019 04:44:14 +0100	[thread overview]
Message-ID: <20190410034414.GW2217@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20190410025808.GA7140@sol.localdomain>

On Tue, Apr 09, 2019 at 07:58:08PM -0700, Eric Biggers wrote:

> It could check a flag IOP_GET_LINK in ->i_opflags instead, so it would be the
> same number of checks.  See patch below.

With that patch ->i_link is completely unused if ->get_link() is non-NULL,
so you get a method call on each traversal...

> Benefits are that we get code that isn't actively misleading (via
> simple_get_link() existing but actually never being called), and filesystems can
> cache a symlink target in ->i_link if it becomes available later, i.e. if it's
> not immediately available at iget() time.  Otherwise a filesystem-private field
> has to be used instead.  (For fscrypt, I'd probably use fscrypt_info::ci_link.)

What's to stop you from doing just that right now?  You'd need to take
care with barriers, but you'd need that anyway... As soon as ->i_link is set
you'll get no more ->get_link() on that sucker, using the cached value
from that point on.  IDGI...

WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro@zeniv.linux.org.uk>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org,
	linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] fscrypt: cache decrypted symlink target in ->i_link
Date: Wed, 10 Apr 2019 04:44:14 +0100	[thread overview]
Message-ID: <20190410034414.GW2217@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20190410025808.GA7140@sol.localdomain>

On Tue, Apr 09, 2019 at 07:58:08PM -0700, Eric Biggers wrote:

> It could check a flag IOP_GET_LINK in ->i_opflags instead, so it would be the
> same number of checks.  See patch below.

With that patch ->i_link is completely unused if ->get_link() is non-NULL,
so you get a method call on each traversal...

> Benefits are that we get code that isn't actively misleading (via
> simple_get_link() existing but actually never being called), and filesystems can
> cache a symlink target in ->i_link if it becomes available later, i.e. if it's
> not immediately available at iget() time.  Otherwise a filesystem-private field
> has to be used instead.  (For fscrypt, I'd probably use fscrypt_info::ci_link.)

What's to stop you from doing just that right now?  You'd need to take
care with barriers, but you'd need that anyway... As soon as ->i_link is set
you'll get no more ->get_link() on that sucker, using the cached value
from that point on.  IDGI...

  reply	other threads:[~2019-04-10  3:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 23:35 [PATCH] fscrypt: cache decrypted symlink target in ->i_link Eric Biggers
2019-04-09 23:35 ` [f2fs-dev] " Eric Biggers
2019-04-10  0:33 ` Al Viro
2019-04-10  0:33   ` Al Viro
2019-04-10  0:45   ` Eric Biggers
2019-04-10  0:45     ` Eric Biggers
2019-04-10  1:04     ` Al Viro
2019-04-10  1:04       ` Al Viro
2019-04-10  1:22       ` Eric Biggers
2019-04-10  1:22         ` [f2fs-dev] " Eric Biggers
2019-04-10  1:22         ` Eric Biggers
2019-04-10  1:39         ` Al Viro
2019-04-10  1:39           ` Al Viro
2019-04-10  2:58           ` Eric Biggers
2019-04-10  2:58             ` Eric Biggers
2019-04-10  3:44             ` Al Viro [this message]
2019-04-10  3:44               ` Al Viro
2019-04-10  4:04               ` Eric Biggers
2019-04-10  4:04                 ` [f2fs-dev] " Eric Biggers
2019-04-10  4:04                 ` Eric Biggers
2019-04-10  4:16                 ` Eric Biggers
2019-04-10  4:31                 ` Al Viro
2019-04-10  4:31                   ` Al Viro
2019-04-10  5:04                   ` Eric Biggers
2019-04-10  5:04                     ` [f2fs-dev] " Eric Biggers
2019-04-10  5:04                     ` Eric Biggers

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=20190410034414.GW2217@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=ebiggers@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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.