[PATCH] 9p: attach-per-user

Previous thread: Ath5k panic fix by Krzysztof Halasa on Monday, September 3, 2007 - 2:35 pm. (1 message)

Next thread: [PATCH -mm] ipc namespace: remove config ipc ns fix by Cedric Le Goater on Monday, September 3, 2007 - 4:22 pm. (1 message)
To: <linux-kernel@...>
Cc: <v9fs-developer@...>, <linux-fsdevel@...>
Date: Monday, September 3, 2007 - 4:18 pm

The 9P2000 protocol requires the authentication and permission checks to be
done in the file server. For that reason every user that accesses the file
server tree has to authenticate and attach to the server separately.
Multiple users can share the same connection to the server.

Currently v9fs does a single attach and executes all I/O operations as a
single user. This makes using v9fs in multiuser environment unsafe as it
depends on the client doing the permission checking.

This patch improves the 9P2000 support by allowing every user to attach
separately. The patch defines three modes of access (new mount option
'access'):

- attach-per-user (access=user)
If a user tries to access a file served by v9fs for the first time, v9fs
sends an attach command to the server (Tattach) specifying the user. If
the attach succeeds, the user can access the v9fs tree.
As there is no uname->uid (string->integer) mapping yet, this mode works
only with the 9P2000.u dialect.

- allow only one user to access the tree (access=<uid>)
Only the user with uid can access the v9fs tree. Other users that attempt
to access it will get EPERM error.

- do all operations as a single user (access=any)
V9fs does a single attach and all operations are done as a single user.
If this mode is selected, the v9fs behavior is identical with the current
one.

The patch also renames uid and gid options to dfltuid and dfltgid. The new
names describe better the values they set.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>

---
commit 836f166ce5578b084c1cd75807e29474586bab61
tree c7e1eb631c3e6b0f1cd773ae7884379776c2857d
parent 3ec910913c8c743cbe4cd9cdde17df26a75d02ec
author Latchesar Ionkov <lucho@eregion.(none)> Mon, 03 Sep 2007 14:09:29 -0600
committer Latchesar Ionkov <lucho@eregion.(none)> Mon, 03 Sep 2007 14:09:29 -0600

fs/9p/fid.c | 157 +++++++++++++++++++++++++++++++++++++----------
fs/9p/v9fs.c | 87 +++++++++++++++++++-------
fs/9...

To: Latchesar Ionkov <lucho@...>
Cc: <linux-kernel@...>, <linux-fsdevel@...>, <v9fs-developer@...>
Date: Tuesday, September 11, 2007 - 10:31 am

nit picks:
* you added/changed options without updated Documentation/filesystems/9p.txt
* you changed v9fs->extended to be part of a flags structure, that
should have been
a separate patch

Even small cleanups like this should probably be confined to a

The way the patch got formatted, these look like compulsive
renames..but there's an added function and then changes to the other
two. I think it might be because of the way you ordered the
functions. Put new functions after the old functions and maybe this
won't happen. And clone seems to have lost his function header. The
code is pretty inconsistent about those these days, but I'd like to do
an audit soon and make sure we have proper comment blocks where
appropriate.

scripts/checkpatch.pl reports:

ERROR: need a space before the open parenthesis '('
#244: FILE: fs/9p/fid.c:147:
+ for(ds = dentry; !IS_ROOT(ds); ds = ds->d_parent)

ERROR: need a space before the open parenthesis '('
#275: FILE: fs/9p/fid.c:178:
+ for(d = dentry, i = n; i >= 0; i--, d = d->d_parent)

Please fix up these small bits and resubmit.

-eric

Also, go ahead and cc: me directly on patches, for some reason this
one missed my normal filters and got lost. If I'm directly cc:'d it
will pop to the top of my inbox.

-eric
-

Previous thread: Ath5k panic fix by Krzysztof Halasa on Monday, September 3, 2007 - 2:35 pm. (1 message)

Next thread: [PATCH -mm] ipc namespace: remove config ipc ns fix by Cedric Le Goater on Monday, September 3, 2007 - 4:22 pm. (1 message)