[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1k4tzvfaj.fsf@fess.ebiederm.org>
Date: Fri, 26 Feb 2010 13:49:08 -0800
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Pavel Emelyanov <xemul@...allels.com>
Cc: hadi@...erus.ca, Daniel Lezcano <dlezcano@...ibm.com>,
Patrick McHardy <kaber@...sh.net>,
Linux Netdev List <netdev@...r.kernel.org>,
containers@...ts.linux-foundation.org,
Netfilter Development Mailinglist
<netfilter-devel@...r.kernel.org>,
Ben Greear <greearb@...delatech.com>,
Serge Hallyn <serue@...ibm.com>,
Matt Helsley <matthltc@...ibm.com>
Subject: Re: [RFC][PATCH] ns: Syscalls for better namespace sharing control.
Pavel Emelyanov <xemul@...allels.com> writes:
> Eric W. Biederman wrote:
>> Pavel Emelyanov <xemul@...allels.com> writes:
>>
>>>> +static struct inode *nsfd_mkinode(void)
>>>> +{
>>>> + struct inode *inode;
>>>> + inode = new_inode(nsfd_mnt->mnt_sb);
>>>> + if (!inode)
>>>> + return ERR_PTR(-ENOMEM);
>>>> +
>>>> + inode->i_fop = &nsfd_file_operations;
>>>> +
>>>> + /*
>>>> + * Mark the inode dirty from the very beginning,
>>>> + * that way it will never be moved to the dirty
>>>> + * list because mark_inode_dirty() will think that
>>>> + * it already _is_ on the dirty list.
>>>> + */
>>>> + inode->i_state = I_DIRTY;
>>>> + inode->i_mode = S_IRUSR | S_IWUSR;
>>>> + inode->i_uid = current_fsuid();
>>>> + inode->i_gid = current_fsgid();
>>>> + inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
>>>> + return inode;
>>>> +}
>>> Why not use anon inodes?
>>
>> Because you can't mount them anywhere.
>
> Worth changing them that way?
I don't think so. They keep all of their state in struct file. To be
usefully bind mounted you need to keep your state in the dentry or the
inode.
Ultimately what I have done is fix rootfs so it supports bind mounts and
used rootfs inodes.
Eric
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists