stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralph Sennhauser <ralph.sennhauser@gmail.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	"stable [v4.9]" <stable@vger.kernel.org>
Subject: Re: [PATCH] ubifs: Fix O_TMPFILE corner case in ubifs_link()
Date: Thu, 30 Mar 2017 11:10:27 +0200	[thread overview]
Message-ID: <20170330111027.2c807fe1@gmail.com> (raw)
In-Reply-To: <CAOQ4uxgd5OPg0YzX+PAoDAEiWDVTiScd9hkKvOPqOOGNNBO=+A@mail.gmail.com>

On Thu, 30 Mar 2017 11:59:17 +0300
Amir Goldstein <amir73il@gmail.com> wrote:

> On Thu, Mar 30, 2017 at 11:56 AM, Richard Weinberger <richard@nod.at>
> wrote:
> > It is perfectly fine to link a tmpfile back using linkat().
> > Since tmpfiles are created with a link count of 0 they appear
> > on the orphan list, upon re-linking the inode has to be removed
> > from the orphan list again.
> >  
> 
> Looks good.

Nothing to add.

Thanks to both of you.
Ralph

> 
> > Cc: <stable@vger.kernel.org>
> > Cc: Ralph Sennhauser <ralph.sennhauser@gmail.com>
> > Cc: Amir Goldstein <amir73il@gmail.com  
> 
> typo: missing closing >
> 
> > Reported-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
> > Tested-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
> > Reported-by: Amir Goldstein <amir73il@gmail.com  
> 
> and here too
> 
> > Fixes: 474b93704f321 ("ubifs: Implement O_TMPFILE")
> > Signed-off-by: Richard Weinberger <richard@nod.at>
> > ---
> >  fs/ubifs/dir.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> > index 0858213a4e63..0139155045fe 100644
> > --- a/fs/ubifs/dir.c
> > +++ b/fs/ubifs/dir.c
> > @@ -748,6 +748,11 @@ static int ubifs_link(struct dentry
> > *old_dentry, struct inode *dir, goto out_fname;
> >
> >         lock_2_inodes(dir, inode);
> > +
> > +       /* Handle O_TMPFILE corner case, it is allowed to link a
> > O_TMPFILE. */
> > +       if (inode->i_nlink == 0)
> > +               ubifs_delete_orphan(c, inode->i_ino);
> > +
> >         inc_nlink(inode);
> >         ihold(inode);
> >         inode->i_ctime = ubifs_current_time(inode);
> > --
> > 2.7.3
> >  

  parent reply	other threads:[~2017-03-30  9:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  8:56 [PATCH] ubifs: Fix O_TMPFILE corner case in ubifs_link() Richard Weinberger
2017-03-30  8:59 ` Amir Goldstein
2017-03-30  9:03   ` Richard Weinberger
2017-03-30  9:07     ` Amir Goldstein
2017-03-30  9:09       ` Richard Weinberger
2017-03-30  9:10   ` Ralph Sennhauser [this message]
2017-03-30  9:32 ` Adrian Hunter
2017-03-30  9:49   ` Richard Weinberger
2017-03-30 10:23     ` Richard Weinberger
2017-03-30 10:35       ` Amir Goldstein
2017-03-30 10:51         ` Richard Weinberger
2017-03-30 11:57       ` Adrian Hunter
2017-03-30 12:27         ` Richard Weinberger
2017-04-06 12:06           ` Amir Goldstein
2017-04-06 12:09             ` Richard Weinberger
2017-04-06 12:26               ` Richard Weinberger
2017-04-11 10:20                 ` Amir Goldstein
2017-04-11 10:50                   ` Richard Weinberger
2017-04-11 15:04                     ` Amir Goldstein
2017-04-17 15:27                       ` Ralph Sennhauser
2017-04-17 15:54                         ` Richard Weinberger
2017-03-30 10:34 ` Hyunchul Lee

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=20170330111027.2c807fe1@gmail.com \
    --to=ralph.sennhauser@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=amir73il@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=stable@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).