mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chuck Lever" <cel@kernel.org>
To: NeilBrown <neil@brown.name>, "Ian Kent" <raven@themaw.net>,
	"Jake Edge" <jake@lwn.net>, "Ilya Dryomov" <idryomov@gmail.com>,
	"Alex Markuze" <amarkuze@redhat.com>,
	"Viacheslav Dubeyko" <slava@dubeyko.com>,
	"Jan Harkes" <jaharkes@cs.cmu.edu>,
	coda@cs.cmu.edu, "Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Christian Brauner" <brauner@kernel.org>,
	"Jan Kara" <jack@suse.cz>, "Trond Myklebust" <trondmy@kernel.org>,
	"Anna Schumaker" <anna@kernel.org>,
	"Amir Goldstein" <amir73il@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Miklos Szeredi" <mszeredi@redhat.com>
Cc: autofs@vger.kernel.org, linux-kernel@vger.kernel.org,
	ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu,
	linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2 04/18] nfs: separate locked regions in nfs_clear_verifier_directory()
Date: Mon, 24 Aug 2026 13:49:05 -0400	[thread overview]
Message-ID: <f9d16f36-10e6-4bec-aa8e-b9b3cb3ad872@app.fastmail.com> (raw)
In-Reply-To: <20260815042707.2535717-5-neilb@ownmail.net>


On Sat, Aug 15, 2026, at 2:21 PM, NeilBrown wrote:
> nfs_clear_verifier_directory() locks the dir to call
>   nfs_unset_verifier_delegated()
> and also to walk the d_children list.
> These are two separate needs and they don't need to both
> be in the same locked region.
>
> Subsequent patches will use a helper for walking the d_children list and
> that helper may drop the lock temporarily.  To simplify this transition,
> split the locked range by dropping and retaking the lock between to make
> two separate locked regions.

I hit this running xfstests against tmpfs with the series applied.  The
trigger was incidental (an unrelated process chmod'ed a file on an
NFSv4 mount while xfstests was running) so it is not deterministic, but
the path looks reachable by any SETATTR that returns a delegation on a
directory:

  BUG: sleeping function called from invalid context at fs/nfs/dir.c:1497
  in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2385380
  preempt_count: 1, expected: 0
  Call Trace:
   __might_resched+0x165/0x180
   nfs_clear_verifier_delegated+0x112/0x250 [nfs]
   nfs_start_delegation_return+0xa1/0x130 [nfsv4]
   nfs4_inode_return_delegation+0x1b/0xf0 [nfsv4]
   nfs4_inode_make_writeable+0xa9/0x130 [nfsv4]
   nfs4_proc_setattr+0xa2/0xf0 [nfsv4]
   nfs_setattr+0x1f2/0x480 [nfs]
   notify_change+0x321/0x380
   chmod_common+0x10d/0x1c0
   do_fchmodat+0x8a/0x110
   __x64_sys_chmod+0x1d/0x30

Line 1497 is the d_for_each_positive_child() call.


-- 
Chuck Lever

  reply	other threads:[~2026-08-24 17:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-15  4:21 [PATCH RFC/RFT v2 00/18] Fix easy bits of the negative dentry problem NeilBrown
2026-08-15  4:21 ` [PATCH v2 01/18] VFS: don't count references through ->d_parent NeilBrown
2026-08-15  4:21 ` [PATCH v2 02/18] autofs: change positive_after() so it takes d_lock rather than the caller NeilBrown
2026-08-15  4:21 ` [PATCH v2 03/18] coda: don't take rcu_read_lock() in coda_flag_children() NeilBrown
2026-08-15  4:21 ` [PATCH v2 04/18] nfs: separate locked regions in nfs_clear_verifier_directory() NeilBrown
2026-08-24 17:49   ` Chuck Lever [this message]
2026-08-25  4:09     ` NeilBrown
2026-08-15  4:21 ` [PATCH v2 05/18] Add and use d_for_each_positive_child family of iterators NeilBrown
2026-08-15  4:21 ` [PATCH v2 06/18] fsnotify: don't hold a spin_lock across fsnotify_recalc_mask() calls NeilBrown
2026-08-15  4:21 ` [PATCH v2 07/18] fsnotify: reduce i_lock hold time in fsnotify_set_children_dentry_flags() NeilBrown
2026-08-15  4:21 ` [PATCH v2 08/18] libfs: simplify scan_positives() NeilBrown
2026-08-15  4:21 ` [PATCH v2 09/18] libfs: change scan_positives() to use d_for_each_positive_child_continue() NeilBrown
2026-08-15  4:21 ` [PATCH v2 10/18] libfs: allow scan_positives() to be called without a cursor NeilBrown
2026-08-15  4:21 ` [PATCH v2 11/18] libfs: replace find_positive_dentry() with scan_positives() NeilBrown
2026-08-15  4:21 ` [PATCH v2 12/18] autofs: don't hold ->lookup_lock in get_next_positive_* NeilBrown
2026-08-15  4:21 ` [PATCH v2 13/18] VFS: don't move dentries in d_sib list when they have the same parent NeilBrown
2026-08-20 13:39   ` Chuck Lever
2026-08-25 21:56     ` NeilBrown
2026-08-26  1:45       ` Chuck Lever
2026-08-15  4:21 ` [PATCH v2 14/18] Call cond_reshed() as needed in d_for_each_positive_child() NeilBrown
2026-08-15  4:21 ` [PATCH v2 15/18] libfs: remove cond_resched() from scan_positives() NeilBrown
2026-08-15  4:21 ` [PATCH v2 16/18] libfs: rename and export scan_positives() NeilBrown
2026-08-15  4:21 ` [PATCH v2 17/18] autofs: replace positive_after() with d_scan_positives() NeilBrown
2026-08-15  4:21 ` [PATCH v2 18/18] autofs: change get_next_positive_dentry() to NOT accept NULL for start-up NeilBrown
2026-08-15  5:03 ` [PATCH RFC/RFT v2 00/18] Fix easy bits of the negative dentry problem Al Viro
2026-08-15  6:12   ` NeilBrown

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=f9d16f36-10e6-4bec-aa8e-b9b3cb3ad872@app.fastmail.com \
    --to=cel@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=amarkuze@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=anna@kernel.org \
    --cc=autofs@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@coda.cs.cmu.edu \
    --cc=idryomov@gmail.com \
    --cc=jack@suse.cz \
    --cc=jaharkes@cs.cmu.edu \
    --cc=jake@lwn.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=neil@brown.name \
    --cc=raven@themaw.net \
    --cc=slava@dubeyko.com \
    --cc=trondmy@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®