linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Krzysztof Wilczyński" <kwilczynski@kernel.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Wei Yang <albinwyang@tencent.com>,
	 Zijie Wang <wangzijie1@honor.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: only bump parent nlink when registering directories
Date: Sun, 14 Jun 2026 05:07:58 +0900	[thread overview]
Message-ID: <20260613200637.GA3447336@rocinante> (raw)
In-Reply-To: <ac6b0e86-468d-4806-a9e4-60df0efdfcef@p183>

Hello,

> > --- a/fs/proc/generic.c
> > +++ b/fs/proc/generic.c
> > @@ -404,7 +404,8 @@ struct proc_dir_entry *proc_register(struct proc_dir_entry *dir,
> >  		write_unlock(&proc_subdir_lock);
> >  		goto out_free_inum;
> >  	}
> > -	dir->nlink++;
> > +	if (S_ISDIR(dp->mode))
> > +		dir->nlink++;
> >  	write_unlock(&proc_subdir_lock);
> 
> nlink accounting should be folded into pde_subdir_insert/pde_erase
> probably but as minimal patch it's OK.

I will follow-up with a v2, then.  Thank you for the review!

All the best,

	Krzysztof

      reply	other threads:[~2026-06-13 20:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12 15:30 [PATCH] proc: only bump parent nlink when registering directories Krzysztof Wilczyński
2026-06-13 15:23 ` Alexey Dobriyan
2026-06-13 20:07   ` Krzysztof Wilczyński [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=20260613200637.GA3447336@rocinante \
    --to=kwilczynski@kernel.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=albinwyang@tencent.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangzijie1@honor.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 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).