From: Joel Becker <Joel.Becker@oracle.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Mike Christie <michaelc@cs.wisc.edu>,
Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
James Bottomley <James.Bottomley@suse.de>,
Jens Axboe <axboe@kernel.dk>, Boaz Harrosh <bharrosh@panasas.com>,
Linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [RFC 02/22] configfs: Add struct configfs_item_operations->check_link() in configfs_unlink()
Date: Mon, 20 Sep 2010 15:06:33 -0700 [thread overview]
Message-ID: <20100920220633.GC8405@mail.oracle.com> (raw)
In-Reply-To: <1284148323.19890.94.camel@haakon2.linux-iscsi.org>
[Sorry on the delay, I was out of town]
On Fri, Sep 10, 2010 at 12:52:03PM -0700, Nicholas A. Bellinger wrote:
> On Fri, 2010-09-10 at 12:44 -0700, Joel Becker wrote:
> > You can refcount without check_link().
>
> So what do you recommend here..?
That your ACL object, or whatever it is that considers itself to
be refcounted by the number of links, keep track of that and only free
itself when all are gone rather than freeing itself when the first goes
away.
> The problem is that the 'unlink sub_child/group1/src_0/src_link' can't
> signal to the other struct config_group to also call an internal 'unlink
> sub_child/group2/dst_0/dst_link' to drop the child link outside of it's
> struct config_group.
Nor should it. I'm asking what is so wrong about a world where
sub_child/group1/src_0/src_link is gone but
sub_child/group2/dst_0/dst_link remains? Maybe that target object can't
work anymore, but the user broke it by breaking the link.
> > You're still fighting allowing the links to go away. You
> > haven't explained why that is necessary. You had a problem with a crash
> > because you expected one reference to your ACLs and actually have two,
> > but you can fix that without modifying configfs.
>
> If this is the case then I must be mis-understanding what you mean by
> configfs consumer refcounting from allow_link() and drop_link(). Can
> you give me a bit more detail where I should be looking..?
Here's how I sort of understood things. First, you create the
src_link pointing to $object. This somehow allocates some sort of ACL
structure hanging off of $object. Then you create dst_link pointing to
src_link, which really ends up pointing to the $object. So now you have
src_link and dst_link pointing to $object.
Finally, someone unlinks src_link. This triggers $object to
free the ACL structure. When the caller later removes dst_link, it
crashes because it was expecting ACL to still be there. Do I have it
right?
I'm saying that $object should count how many people are
pointing to it, so that when you remove src_link, ACL is *not* freed.
It will only be freed when both src_link and dst_link are removed. This
way you do not crash. Perhaps I'm not understanding the ACL object.
Perhaps I'm missing the mechanism entirely. But I don't see why the ACL
object must necessarily be freed when one symlink is removed but not the
other.
Joel
--
"And yet I fight,
And yet I fight this battle all alone.
No one to cry to;
No place to call home."
Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2010-09-20 22:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1283160025-6598-1-git-send-email-nab@linux-iscsi.org>
[not found] ` <201009020031.08750.konrad@darnok.org>
[not found] ` <20100902064814.GB27904@mail.oracle.com>
2010-09-02 19:40 ` [RFC 02/22] configfs: Add struct configfs_item_operations->check_link() in configfs_unlink() Nicholas A. Bellinger
2010-09-07 21:01 ` Konrad Rzeszutek Wilk
2010-09-07 22:44 ` Joel Becker
2010-09-08 2:08 ` Nicholas A. Bellinger
2010-09-08 19:26 ` Joel Becker
2010-09-08 20:53 ` Nicholas A. Bellinger
2010-09-10 15:28 ` Joel Becker
2010-09-10 19:06 ` Nicholas A. Bellinger
2010-09-10 19:44 ` Joel Becker
2010-09-10 19:52 ` Nicholas A. Bellinger
2010-09-20 22:06 ` Joel Becker [this message]
2010-09-22 7:16 ` Nicholas A. Bellinger
2010-09-22 11:18 ` Boaz Harrosh
2010-09-22 11:54 ` Nicholas A. Bellinger
2010-09-23 3:59 ` Joel Becker
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=20100920220633.GC8405@mail.oracle.com \
--to=joel.becker@oracle.com \
--cc=James.Bottomley@suse.de \
--cc=axboe@kernel.dk \
--cc=bharrosh@panasas.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=konrad@darnok.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=nab@linux-iscsi.org \
/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).