Re: [PATCH 02/17] new helper: simple_start_creating()

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

 



On Fri, 2025-06-13 at 23:36 +0100, Al Viro wrote:
> On Fri, Jun 13, 2025 at 02:31:56PM -0400, Jeff Layton wrote:
> > > -	if (unlikely(IS_DEADDIR(d_inode(parent))))
> > > -		dentry = ERR_PTR(-ENOENT);
> > > -	else
> > > -		dentry = lookup_noperm(&QSTR(name), parent);
> > > -	if (!IS_ERR(dentry) && d_really_is_positive(dentry)) {
> > > -		if (d_is_dir(dentry))
> > > -			pr_err("Directory '%s' with parent '%s' already present!\n",
> > > -			       name, parent->d_name.name);
> > > -		else
> > > -			pr_err("File '%s' in directory '%s' already present!\n",
> > > -			       name, parent->d_name.name);
> > 
> > Any chance we could keep a pr_err() for this case? I was doing some
> > debugfs work recently, and found it helpful.
> 
> Umm...  Not in simple_start_creating(), obviously, but...
> Would something like
> 	dentry = simple_start_creating(parent, name);
>         if (IS_ERR(dentry)) {
> 		if (dentry == ERR_PTR(-EEXIST))
> 			pr_err("'%s' already exists in '%pd'\n", name, parent);
> 		simple_release_fs(&debugfs_mount, &debugfs_mount_count);
> 	}
> work for you?

That's exactly what I was thinking.
-- 
Jeff Layton <jlayton@xxxxxxxxxx>





[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