Re: [RFC PATCH 1/6] fs/9p: Add ability to identify inode by path for .L

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 06, 2025 at 09:43:02PM +0100, Tingmao Wang wrote:

> +struct v9fs_ino_path *make_ino_path(struct dentry *dentry)
> +{
> +	struct v9fs_ino_path *path;
> +	size_t path_components = 0;
> +	struct dentry *curr = dentry;
> +	ssize_t i;
> +
> +	lockdep_assert_held_read(&v9fs_dentry2v9ses(dentry)->rename_sem);
> +
> +	rcu_read_lock();
> +
> +    /* Don't include the root dentry */
> +	while (curr->d_parent != curr) {
> +		path_components++;
> +		curr = curr->d_parent;
> +	}
> +	if (WARN_ON(path_components > SSIZE_MAX)) {
> +		rcu_read_unlock();
> +		return NULL;
> +	}
> +
> +	path = kmalloc(struct_size(path, names, path_components),
> +		       GFP_KERNEL);

Blocking allocation under rcu_read_lock().




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux