From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Yan, Zheng" <zyan@redhat.com>
Cc: Sage Weil <sweil@redhat.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
ceph-devel@vger.kernel.org
Subject: Re: [ceph] what's going on with d_rehash() in splice_dentry()?
Date: Mon, 7 Mar 2016 02:16:39 +0000 [thread overview]
Message-ID: <20160307021639.GR17997@ZenIV.linux.org.uk> (raw)
In-Reply-To: <B17B70FF-4B76-4593-9D96-F0298F83AEB3@redhat.com>
On Wed, Mar 02, 2016 at 11:00:01AM +0800, Yan, Zheng wrote:
> > This code dates back to when Ceph was originally upstreamed, so the
> > history is murky, but I expect at that point I wanted to avoid hashing in
> > the no-lease case. But I don't think it matters. We should just remove
> > the prehash argument from splice_dentry entirely.
> >
> > Zheng, does that sound right?
>
> Yes. I think we can remove the d_rehash(dn) call and rehash parameter.
Another question in the same general area:
/* null dentry? */
if (!rinfo->head->is_target) {
dout("fill_trace null dentry\n");
if (d_really_is_positive(dn)) {
ceph_dir_clear_ordered(dir);
dout("d_delete %p\n", dn);
d_delete(dn);
} else {
dout("d_instantiate %p NULL\n", dn);
d_instantiate(dn, NULL);
if (have_lease && d_unhashed(dn))
d_rehash(dn);
update_dentry_lease(dn, rinfo->dlease,
session,
req->r_request_started);
}
goto done;
}
What's that d_instantiate() about? We have just checked that it's
negative; what's the point of setting ->d_inode to NULL again? Would it
be OK if we just do
} else {
if (have_lease && d_unhashed(dn))
d_add(dn, NULL);
update_dentry_lease(dn, rinfo->dlease,
session,
req->r_request_started);
}
in there? As an aside, tracking back to the originating fs method is
painful as hell ;-/ I _think_ that rehash can be hit during ->lookup()
returning a negative, but I wouldn't bet a dime on it not happening from
other methods... AFAICS, the change should be OK regardless of what
it's been called from, but... _ouch_. Is is documented anywhere public?
next prev parent reply other threads:[~2016-03-07 2:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 17:42 [ceph] what's going on with d_rehash() in splice_dentry()? Al Viro
2016-03-01 14:50 ` Sage Weil
2016-03-02 3:00 ` Yan, Zheng
2016-03-07 2:16 ` Al Viro [this message]
2016-03-07 11:25 ` Sage Weil
2016-03-07 14:56 ` Al Viro
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=20160307021639.GR17997@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=ceph-devel@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sweil@redhat.com \
--cc=zyan@redhat.com \
/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).