Thread (1 message) 1 message, 1 author, 2008-01-08

Re: [patch 5/9] unprivileged mounts: allow unprivileged bind mounts

From: Miklos Szeredi <miklos@szeredi.hu>
Date: 2008-01-08 19:10:22
Also in: lkml

On Tue, 2008-01-08 at 12:35 +0100, Miklos Szeredi wrote:
quoted
+static int reserve_user_mount(void)
+{
+       int err = 0;
+
+       spin_lock(&vfsmount_lock);
+       if (nr_user_mounts >= max_user_mounts && !capable(CAP_SYS_ADMIN))
+               err = -EPERM;
+       else
+               nr_user_mounts++;
+       spin_unlock(&vfsmount_lock);
+       return err;
+} 
Would -ENOSPC or -ENOMEM be a more descriptive error here?  
The logic behind EPERM, is that this failure is only for unprivileged
callers.  ENOMEM is too specifically about OOM.  It could be changed
to ENOSPC, ENFILE, EMFILE, or it could remain EPERM.  What do others
think?

Miklos
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help