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.