On Wed, 2012-10-10 at 08:27 +0200, Tomas Mraz wrote:
On Wed, 2012-10-10 at 01:32 +0400, Dmitry V. Levin wrote:
> On Tue, Oct 09, 2012 at 06:28:18PM +0200, Tomas Mraz wrote:
> > On Tue, 2012-10-09 at 15:42 +0400, Dmitry V. Levin wrote:
> > > On Tue, Oct 09, 2012 at 12:51:44PM +0200, Tomas Mraz wrote:
> > > > The attached patch allows specification of size of the tmpfs mount
in
> > > > pam_namespace.
> > >
> > > Wouldn't it allow passing other tmpfs mount options as well?
> > > In that case, calling it "size" would be misleading.
> >
> > It would as a side-effect, however there is no proper escaping done, so
> > some of the possible tmpfs mount options cannot be passed (at least some
> > kind of escaping for ':' would be needed).
>
> The only tmpfs mount option I could think of that can take an argument
> containing ":" is a rare option called "mpol". I agree it would
be nice
> to have an interface to specify tmpfs size, but there are other parameters
> like "nr_inodes" that are sometimes as important as "size".
That's why in
> my opinion "size" is not an appropriate name for an arbitrary tmpfs mount
> options string starting with "size". I suggest to call things what they
> really are.
>
> Another issue is that tmpfs mount options string has sense only if
"tmpfs"
> was specified. The implementation should not leave such errors
> undetected.
>
> How about extending "tmpfs" syntax to allow mount options, e.g.
> "tmpfs,size=..."? It seems to address both issues.
I really don't like this, to me the natural place where to put the mount
options is the flags field which already allows specification of
multiple flags.
So my proposal is to use 'mntopts' flag for that:
tmpfs mntopts=size=100M,nr_inodes=10000
I'd probably avoid the escaping of ':' in the first implementation.
I'll add syslog warning if mntopts is used with other polyinstantiation
methods than tmpfs.
And here is the mntopts flag implemented. OK to commit?
--
Tomas Mraz
No matter how far down the wrong road you've gone, turn back.
Turkish proverb