From: Dan Carpenter <dan.carpenter@oracle.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [bug report] ovl: copy up of disconnected dentries
Date: Mon, 22 Mar 2021 15:35:34 +0300 [thread overview]
Message-ID: <20210322123534.GG1667@kadam> (raw)
In-Reply-To: <CAOQ4uxjNVHGReF5_TXBXHdVb0asJ4RQH_CT6Gy7r1J8MWEe1yg@mail.gmail.com>
On Mon, Mar 22, 2021 at 02:25:44PM +0200, Amir Goldstein wrote:
> On Mon, Mar 22, 2021 at 2:18 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > Hello Amir Goldstein,
> >
> > The patch aa3ff3c152ff: "ovl: copy up of disconnected dentries" from
> > Oct 15, 2017, leads to the following static checker warning:
>
> Heh! that's fashionably late :)
>
;)
> >
> > fs/overlayfs/copy_up.c:972 ovl_copy_up_flags()
> > warn: 'old_cred' not released on lines: 944.
> >
> > fs/overlayfs/copy_up.c
> > 932 static int ovl_copy_up_flags(struct dentry *dentry, int flags)
> > 933 {
> > 934 int err = 0;
> > 935 const struct cred *old_cred = ovl_override_creds(dentry->d_sb);
> > 936 bool disconnected = (dentry->d_flags & DCACHE_DISCONNECTED);
> > 937
> > 938 /*
> > 939 * With NFS export, copy up can get called for a disconnected non-dir.
> > 940 * In this case, we will copy up lower inode to index dir without
> > 941 * linking it to upper dir.
> > 942 */
> > 943 if (WARN_ON(disconnected && d_is_dir(dentry)))
> > 944 return -EIO;
> >
> > Should this call revert_creds(old_cred); before returning?
>
> Yes. Here's a simple fix, care to post it?
Sure. I'm always happy to take credit for your work. I'll send it
tomorrow.
regards,
dan carpenter
prev parent reply other threads:[~2021-03-22 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 12:18 [bug report] ovl: copy up of disconnected dentries Dan Carpenter
2021-03-22 12:25 ` Amir Goldstein
2021-03-22 12:35 ` Dan Carpenter [this message]
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=20210322123534.GG1667@kadam \
--to=dan.carpenter@oracle.com \
--cc=amir73il@gmail.com \
--cc=linux-unionfs@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 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).