[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8028d6c8b484c1867aa0e9f668b658b1cb7e9521.camel@ibm.com>
Date: Thu, 24 Jul 2025 18:30:34 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>
CC: "frank.li@...o.com" <frank.li@...o.com>,
"glaubitz@...sik.fu-berlin.de"
<glaubitz@...sik.fu-berlin.de>,
"slava@...eyko.com" <slava@...eyko.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v4 1/3] hfsplus: fix to update ctime after rename
On Wed, 2025-07-23 at 22:25 +0100, Al Viro wrote:
> On Wed, Jul 23, 2025 at 05:58:01PM +0000, Viacheslav Dubeyko wrote:
>
> > So, this line simply copies CNID from old_dentry->d_fsdata to
> > new_dentry->d_fsdata during the rename operation. I assume that
> > ->fs_data should be untouched by generic logic of dentries processing.
>
> Yes, I understand that; what I do not understand is why. Why would
> the CNID of renamed object be slapped on dentry of removed target?
> I'm trying to understand the logics with link(2) and unlink-of-opened
> in that code...
>
> Incidentally, what happens if you
> fd = creat("foo", 0666);
> write(fd, "foo", 3);
> link("foo", "bar");
> unlink("bar");
> close(fd);
> The games with S_DEAD in there look odd...
Probably, I am missing something in your course of logic. :)
I assume that you are worried about this part:
/* Unlink destination if it already exists */
if (d_really_is_positive(new_dentry)) {
if (d_is_dir(new_dentry))
res = hfsplus_rmdir(new_dir, new_dentry);
else
res = hfsplus_unlink(new_dir, new_dentry);
if (res)
return res;
}
If we have called hfsplus_rmdir() or hfsplus_unlink(), then this action:
> > + new_dentry->d_fsdata = old_dentry->d_fsdata;
doesn't make sense. Am I correct?
But if we didn't call hfsplus_rmdir() or hfsplus_unlink(), then we still need to
make this assignment. Do I follow your point?
Thanks,
Slava.
Powered by blists - more mailing lists