Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1351265

Re: [ceph] what's going on with d_rehash() in splice_dentry()?

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [ceph] what's going on with d_rehash() in splice_dentry()?
Date 2016-03-07 03:20 +0100
Message-ID <r9SW6-4YY-5@gated-at.bofh.it> (permalink)
References <r6uGC-6KV-21@gated-at.bofh.it> <r7TWi-216-21@gated-at.bofh.it> <r85kJ-1DR-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [ceph] what's going on with d_rehash() in splice_dentry()? Al Viro <viro@ZenIV.linux.org.uk> - 2016-03-07 03:20 +0100
  Re: [ceph] what's going on with d_rehash() in splice_dentry()? Sage Weil <sweil@redhat.com> - 2016-03-07 12:30 +0100
    Re: [ceph] what's going on with d_rehash() in splice_dentry()? Al Viro <viro@ZenIV.linux.org.uk> - 2016-03-07 16:00 +0100

csiph-web