linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: brauner@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, josef@toxicpanda.com
Subject: Re: [PATCH v2 1/2] vfs: add rcu-based find_inode variants for iget ops
Date: Mon, 10 Jun 2024 21:59:38 -0700	[thread overview]
Message-ID: <ZmfZukP3a2atzQma@infradead.org> (raw)
In-Reply-To: <20240610195828.474370-2-mjguzik@gmail.com>

> +EXPORT_SYMBOL(iget5_locked_rcu);

EXPORT_SYMBOL_GPL for rcu APIs.

> +static void __wait_on_freeing_inode(struct inode *inode, bool locked)
>  {
>  	wait_queue_head_t *wq;
>  	DEFINE_WAIT_BIT(wait, &inode->i_state, __I_NEW);
>  	wq = bit_waitqueue(&inode->i_state, __I_NEW);
>  	prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE);
>  	spin_unlock(&inode->i_lock);
> -	spin_unlock(&inode_hash_lock);
> +	rcu_read_unlock();
> +	if (locked)
> +		spin_unlock(&inode_hash_lock);

The conditional locking here is goign to make sparse rather unhappy.
Please try to find a way to at least annotate it, or maybe find
another way around like, like leaving the schedule in finish_wait
in the callers.

> +extern struct inode *ilookup5_nowait_rcu(struct super_block *sb,
> +		unsigned long hashval, int (*test)(struct inode *, void *),
> +		void *data);

No need for the extern here (or down below).


  reply	other threads:[~2024-06-11  4:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 19:58 [PATCH v2 0/2] rcu-based inode lookup for iget* Mateusz Guzik
2024-06-10 19:58 ` [PATCH v2 1/2] vfs: add rcu-based find_inode variants for iget ops Mateusz Guzik
2024-06-11  4:59   ` Christoph Hellwig [this message]
2024-06-11  5:17     ` Mateusz Guzik
2024-06-11  5:20       ` Christoph Hellwig
2024-06-11  5:36         ` Mateusz Guzik
2024-06-11  6:05           ` Christoph Hellwig
2024-06-10 19:58 ` [PATCH v2 2/2] btrfs: use iget5_locked_rcu Mateusz Guzik

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=ZmfZukP3a2atzQma@infradead.org \
    --to=hch@infradead.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).