AFS: Add a MAINTAINERS record for AFS
David Howells
maintainerPATCH 1/2 AFS: Add a MAINTAINERS record for AFS
Add a MAINTAINERS record for AFS
Signed-off-by David Howells <[email protected]>
---
MAINTAINERS | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
MAINTAINERS +6 -0
@@ -163,6 +163,12 @@ M: [email protected] L: [email protected] S: Maintained +AFS FILESYSTEM & AF_RXRPC SOCKET DOMAIN +P: David Howells +M: [email protected] +L: [email protected] +S: Supported + AIO P: Benjamin LaHaise M: [email protected]
David Howells
maintainerPATCH 2/2 AFS: prevent double cell registration
kafs doesn't check if the cell already exists - so if you do an echo "add newcell.org 1.2.3.4" >/proc/fs/afs/cells it will try to create this cell again. kobject will also complain about a double registration. To prevent such problems, return -EEXIST in that case.
Signed-off-by Sven Schnelle <[email protected]>
Signed-off-by David Howells <[email protected]>
---
fs/afs/cell.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-)
fs/afs/cell.c +13 -2
@@ -127,14 +127,20 @@ struct afs_cell *afs_cell_create(const char *name, char *vllist)_enter ("%s,%s" , name, vllist); +down_write (&afs_cells_sem); +read_lock (&afs_cells_lock); +list_for_each_entry (cell, &afs_cells, link) { +if (strcasecmp (cell->name, name) ==0 ) + goto duplicate_name; + } +read_unlock (&afs_cells_lock); + cell =afs_cell_alloc (name, vllist);if (IS_ERR (cell)) {_leave (" = %ld" ,PTR_ERR (cell));return cell; } -down_write (&afs_cells_sem); -/* add a proc directory for this cell */ ret =afs_proc_cell_setup (cell);if (ret <0 )
@@ -167,6 +173,11 @@ error:kfree (cell);_leave (" = %d" , ret);return ERR_PTR (ret); + +duplicate_name: +read_unlock (&afs_cells_lock); +up_write (&afs_cells_sem); +return ERR_PTR (-EEXIST ); }/*