From: Eric Biggers <ebiggers@kernel.org>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: linux-mtd@lists.infradead.org, linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH] ubifs: remove unnecessary calls to set up directory key
Date: Thu, 18 Apr 2019 12:29:32 -0700 [thread overview]
Message-ID: <20190418192930.GA20640@gmail.com> (raw)
In-Reply-To: <CAFLxGvw1ETyuLf0yV_MqGyTKmUkxLu0vvZLh2QfLgvYExTosWQ@mail.gmail.com>
On Fri, Mar 15, 2019 at 10:05:59PM +0100, Richard Weinberger wrote:
> On Fri, Mar 15, 2019 at 9:55 PM Eric Biggers <ebiggers@kernel.org> wrote:
> >
> > From: Eric Biggers <ebiggers@google.com>
> >
> > In ubifs_unlink() and ubifs_rmdir(), remove the call to
> > fscrypt_get_encryption_info() that precedes fscrypt_setup_filename().
> > This call was unnecessary, because fscrypt_setup_filename() already
> > tries to set up the directory's encryption key.
> >
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > ---
> > fs/ubifs/dir.c | 12 ------------
> > 1 file changed, 12 deletions(-)
> >
> > diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> > index 5767b373a8ff..c3311ea68fe5 100644
> > --- a/fs/ubifs/dir.c
> > +++ b/fs/ubifs/dir.c
> > @@ -792,12 +792,6 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry)
> > dentry, inode->i_ino,
> > inode->i_nlink, dir->i_ino);
> >
> > - if (ubifs_crypt_is_encrypted(dir)) {
> > - err = fscrypt_get_encryption_info(dir);
> > - if (err && err != -ENOKEY)
> > - return err;
> > - }
> > -
> > err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm);
> > if (err)
> > return err;
> > @@ -902,12 +896,6 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry)
> > if (err)
> > return err;
> >
> > - if (ubifs_crypt_is_encrypted(dir)) {
> > - err = fscrypt_get_encryption_info(dir);
> > - if (err && err != -ENOKEY)
> > - return err;
> > - }
> > -
> > err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm);
> > if (err)
> > return err;
>
> Thanks for the cleanup, Eric!
>
> --
> Thanks,
> //richard
Richard, can you take this through the ubifs tree for 5.2?
- Eric
WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: linux-fscrypt@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] ubifs: remove unnecessary calls to set up directory key
Date: Thu, 18 Apr 2019 12:29:32 -0700 [thread overview]
Message-ID: <20190418192930.GA20640@gmail.com> (raw)
In-Reply-To: <CAFLxGvw1ETyuLf0yV_MqGyTKmUkxLu0vvZLh2QfLgvYExTosWQ@mail.gmail.com>
On Fri, Mar 15, 2019 at 10:05:59PM +0100, Richard Weinberger wrote:
> On Fri, Mar 15, 2019 at 9:55 PM Eric Biggers <ebiggers@kernel.org> wrote:
> >
> > From: Eric Biggers <ebiggers@google.com>
> >
> > In ubifs_unlink() and ubifs_rmdir(), remove the call to
> > fscrypt_get_encryption_info() that precedes fscrypt_setup_filename().
> > This call was unnecessary, because fscrypt_setup_filename() already
> > tries to set up the directory's encryption key.
> >
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > ---
> > fs/ubifs/dir.c | 12 ------------
> > 1 file changed, 12 deletions(-)
> >
> > diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> > index 5767b373a8ff..c3311ea68fe5 100644
> > --- a/fs/ubifs/dir.c
> > +++ b/fs/ubifs/dir.c
> > @@ -792,12 +792,6 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry)
> > dentry, inode->i_ino,
> > inode->i_nlink, dir->i_ino);
> >
> > - if (ubifs_crypt_is_encrypted(dir)) {
> > - err = fscrypt_get_encryption_info(dir);
> > - if (err && err != -ENOKEY)
> > - return err;
> > - }
> > -
> > err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm);
> > if (err)
> > return err;
> > @@ -902,12 +896,6 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry)
> > if (err)
> > return err;
> >
> > - if (ubifs_crypt_is_encrypted(dir)) {
> > - err = fscrypt_get_encryption_info(dir);
> > - if (err && err != -ENOKEY)
> > - return err;
> > - }
> > -
> > err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm);
> > if (err)
> > return err;
>
> Thanks for the cleanup, Eric!
>
> --
> Thanks,
> //richard
Richard, can you take this through the ubifs tree for 5.2?
- Eric
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-04-18 19:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-15 20:54 [PATCH] ubifs: remove unnecessary calls to set up directory key Eric Biggers
2019-03-15 20:54 ` Eric Biggers
2019-03-15 21:05 ` Richard Weinberger
2019-03-15 21:05 ` Richard Weinberger
2019-04-18 19:29 ` Eric Biggers [this message]
2019-04-18 19:29 ` 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=20190418192930.GA20640@gmail.com \
--to=ebiggers@kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard.weinberger@gmail.com \
/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.