public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Tejun Heo <tj@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Konstantin Khorenko <khorenko@virtuozzo.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH RFC 0/1] kernfs: hit a warning in kernfs_get()
Date: Tue, 16 Apr 2019 18:53:34 +0300	[thread overview]
Message-ID: <20190416155335.14627-1-khorenko@virtuozzo.com> (raw)

We hit a warning on rather old kernel - RHEL7-based 3.10.0-xxx.
Please don't think it's really near 3.10 - both RedHat and we (Virtuozzo)
backport a lot of things from modern mainstream kernels and do own changes.

  ------------[ cut here ]------------
  WARNING: CPU: 2 PID: 63923 at fs/kernfs/dir.c:377 kernfs_get+0x2f/0x40
  CPU: 2 PID: 63923 Comm: kworker/2:7 ve: 0 Kdump: loaded Not tainted
       3.10.0-957.10.1.vz7.85.12 #1 85.12
  ...
  Call Trace:
   [<ffffffffa7f92e67>] dump_stack+0x19/0x1b
   [<ffffffffa78987b8>] __warn+0xd8/0x100
   [<ffffffffa78988fd>] warn_slowpath_null+0x1d/0x20
   [<ffffffffa7aecaff>] kernfs_get+0x2f/0x40
   [<ffffffffa7aed233>] __kernfs_remove+0x113/0x260
   [<ffffffffa7aee201>] kernfs_remove+0x21/0x30
   [<ffffffffa7af1010>] sysfs_remove_dir+0x50/0x80
   [<ffffffffa7b9fb38>] kobject_del+0x18/0x50
   [<ffffffffa7a38a4d>] sysfs_slab_remove+0x3d/0x50
   [<ffffffffa79f1e6b>] do_kmem_cache_release+0x3b/0x70
   [<ffffffffa79f2aa1>] memcg_destroy_kmem_caches+0xb1/0xf0
   [<ffffffffa7a4ed5c>] mem_cgroup_css_free+0x4c/0x280
   [<ffffffffa79377fc>] cgroup_free_fn+0x4c/0x120
   [<ffffffffa78bc222>] process_one_work+0x182/0x440
   [<ffffffffa78bd3d6>] worker_thread+0x126/0x3c0
   [<ffffffffa78c4441>] kthread+0xd1/0xe0

The warning has been triggered only once and so far i'm unable to reproduce it.

i'm not completely sure why __kernfs_remove() believes "pos" should always
have kn->counter > 0 as it holds kernfs_mutex, but kernfs_notify_workfn()
could definitely do a kernfs_put() out of kernfs_mutex.

So i suppose kernfs_put() should be put under kernfs_mutex() in
kernfs_notify_workfn().


Konstantin Khorenko (1):
  kernfs: keep kernfs node alive for __kernfs_remove()

 fs/kernfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.15.1


             reply	other threads:[~2019-04-16 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 15:53 Konstantin Khorenko [this message]
2019-04-16 15:53 ` [PATCH RFC 1/1] kernfs: keep kernfs node alive for __kernfs_remove() Konstantin Khorenko
2019-04-16 19:17   ` Tejun Heo
2019-04-17 16:12     ` Konstantin Khorenko
2019-04-17 19:26       ` Tejun Heo

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=20190416155335.14627-1-khorenko@virtuozzo.com \
    --to=khorenko@virtuozzo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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