[AFS/AF_RXRPC]: Miscellaneous fixes.
Make miscellaneous fixes to AFS and AF_RXRPC: (*) Make AF_RXRPC select KEYS rather than RXKAD or AFS_FS in Kconfig. (*) Don't use FS_BINARY_MOUNTDATA. (*) Remove a done 'TODO' item in a comemnt on afs_get_sb(). (*) Don't pass a void * as the page pointer argument of kmap_atomic() as this breaks on m68k. Patch from Geert Uytterhoeven <geert@linux-m68k.org>. (*) Use match_*() functions rather than doing my own parsing. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ef4533f8af
commit
80c72fe415
@ -2020,7 +2020,6 @@ config AFS_FS
|
|||||||
tristate "Andrew File System support (AFS) (EXPERIMENTAL)"
|
tristate "Andrew File System support (AFS) (EXPERIMENTAL)"
|
||||||
depends on INET && EXPERIMENTAL
|
depends on INET && EXPERIMENTAL
|
||||||
select AF_RXRPC
|
select AF_RXRPC
|
||||||
select KEYS
|
|
||||||
help
|
help
|
||||||
If you say Y here, you will get an experimental Andrew File System
|
If you say Y here, you will get an experimental Andrew File System
|
||||||
driver. It currently only supports unsecured read-only AFS access.
|
driver. It currently only supports unsecured read-only AFS access.
|
||||||
|
@ -266,7 +266,8 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call,
|
|||||||
call->unmarshall++;
|
call->unmarshall++;
|
||||||
|
|
||||||
if (call->count < PAGE_SIZE) {
|
if (call->count < PAGE_SIZE) {
|
||||||
buffer = kmap_atomic(call->reply3, KM_USER0);
|
page = call->reply3;
|
||||||
|
buffer = kmap_atomic(page, KM_USER0);
|
||||||
memset(buffer + PAGE_SIZE - call->count, 0,
|
memset(buffer + PAGE_SIZE - call->count, 0,
|
||||||
call->count);
|
call->count);
|
||||||
kunmap_atomic(buffer, KM_USER0);
|
kunmap_atomic(buffer, KM_USER0);
|
||||||
|
100
fs/afs/super.c
100
fs/afs/super.c
@ -20,6 +20,7 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
|
#include <linux/parser.h>
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
#define AFS_FS_MAGIC 0x6B414653 /* 'kAFS' */
|
#define AFS_FS_MAGIC 0x6B414653 /* 'kAFS' */
|
||||||
@ -42,7 +43,7 @@ struct file_system_type afs_fs_type = {
|
|||||||
.name = "afs",
|
.name = "afs",
|
||||||
.get_sb = afs_get_sb,
|
.get_sb = afs_get_sb,
|
||||||
.kill_sb = kill_anon_super,
|
.kill_sb = kill_anon_super,
|
||||||
.fs_flags = FS_BINARY_MOUNTDATA,
|
.fs_flags = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct super_operations afs_super_ops = {
|
static const struct super_operations afs_super_ops = {
|
||||||
@ -58,6 +59,20 @@ static const struct super_operations afs_super_ops = {
|
|||||||
static struct kmem_cache *afs_inode_cachep;
|
static struct kmem_cache *afs_inode_cachep;
|
||||||
static atomic_t afs_count_active_inodes;
|
static atomic_t afs_count_active_inodes;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
afs_no_opt,
|
||||||
|
afs_opt_cell,
|
||||||
|
afs_opt_rwpath,
|
||||||
|
afs_opt_vol,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const match_table_t afs_options_list = {
|
||||||
|
{ afs_opt_cell, "cell=%s" },
|
||||||
|
{ afs_opt_rwpath, "rwpath" },
|
||||||
|
{ afs_opt_vol, "vol=%s" },
|
||||||
|
{ afs_no_opt, NULL },
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialise the filesystem
|
* initialise the filesystem
|
||||||
*/
|
*/
|
||||||
@ -114,31 +129,6 @@ void __exit afs_fs_exit(void)
|
|||||||
_leave("");
|
_leave("");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* check that an argument has a value
|
|
||||||
*/
|
|
||||||
static int want_arg(char **_value, const char *option)
|
|
||||||
{
|
|
||||||
if (!_value || !*_value || !**_value) {
|
|
||||||
printk(KERN_NOTICE "kAFS: %s: argument missing\n", option);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* check that there's no subsequent value
|
|
||||||
*/
|
|
||||||
static int want_no_value(char *const *_value, const char *option)
|
|
||||||
{
|
|
||||||
if (*_value && **_value) {
|
|
||||||
printk(KERN_NOTICE "kAFS: %s: Invalid argument: %s\n",
|
|
||||||
option, *_value);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* parse the mount options
|
* parse the mount options
|
||||||
* - this function has been shamelessly adapted from the ext3 fs which
|
* - this function has been shamelessly adapted from the ext3 fs which
|
||||||
@ -148,48 +138,46 @@ static int afs_parse_options(struct afs_mount_params *params,
|
|||||||
char *options, const char **devname)
|
char *options, const char **devname)
|
||||||
{
|
{
|
||||||
struct afs_cell *cell;
|
struct afs_cell *cell;
|
||||||
char *key, *value;
|
substring_t args[MAX_OPT_ARGS];
|
||||||
int ret;
|
char *p;
|
||||||
|
int token;
|
||||||
|
|
||||||
_enter("%s", options);
|
_enter("%s", options);
|
||||||
|
|
||||||
options[PAGE_SIZE - 1] = 0;
|
options[PAGE_SIZE - 1] = 0;
|
||||||
|
|
||||||
ret = 0;
|
while ((p = strsep(&options, ","))) {
|
||||||
while ((key = strsep(&options, ","))) {
|
if (!*p)
|
||||||
value = strchr(key, '=');
|
continue;
|
||||||
if (value)
|
|
||||||
*value++ = 0;
|
|
||||||
|
|
||||||
_debug("kAFS: KEY: %s, VAL:%s", key, value ?: "-");
|
token = match_token(p, afs_options_list, args);
|
||||||
|
switch (token) {
|
||||||
if (strcmp(key, "rwpath") == 0) {
|
case afs_opt_cell:
|
||||||
if (!want_no_value(&value, "rwpath"))
|
cell = afs_cell_lookup(args[0].from,
|
||||||
return -EINVAL;
|
args[0].to - args[0].from);
|
||||||
params->rwpath = 1;
|
|
||||||
} else if (strcmp(key, "vol") == 0) {
|
|
||||||
if (!want_arg(&value, "vol"))
|
|
||||||
return -EINVAL;
|
|
||||||
*devname = value;
|
|
||||||
} else if (strcmp(key, "cell") == 0) {
|
|
||||||
if (!want_arg(&value, "cell"))
|
|
||||||
return -EINVAL;
|
|
||||||
cell = afs_cell_lookup(value, strlen(value));
|
|
||||||
if (IS_ERR(cell))
|
if (IS_ERR(cell))
|
||||||
return PTR_ERR(cell);
|
return PTR_ERR(cell);
|
||||||
afs_put_cell(params->cell);
|
afs_put_cell(params->cell);
|
||||||
params->cell = cell;
|
params->cell = cell;
|
||||||
} else {
|
break;
|
||||||
printk("kAFS: Unknown mount option: '%s'\n", key);
|
|
||||||
ret = -EINVAL;
|
case afs_opt_rwpath:
|
||||||
goto error;
|
params->rwpath = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case afs_opt_vol:
|
||||||
|
*devname = args[0].from;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printk(KERN_ERR "kAFS:"
|
||||||
|
" Unknown or invalid mount option: '%s'\n", p);
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
_leave(" = 0");
|
||||||
error:
|
return 0;
|
||||||
_leave(" = %d", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -361,7 +349,6 @@ static int afs_fill_super(struct super_block *sb, void *data)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* get an AFS superblock
|
* get an AFS superblock
|
||||||
* - TODO: don't use get_sb_nodev(), but rather call sget() directly
|
|
||||||
*/
|
*/
|
||||||
static int afs_get_sb(struct file_system_type *fs_type,
|
static int afs_get_sb(struct file_system_type *fs_type,
|
||||||
int flags,
|
int flags,
|
||||||
@ -386,7 +373,6 @@ static int afs_get_sb(struct file_system_type *fs_type,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ret = afs_parse_device_name(¶ms, dev_name);
|
ret = afs_parse_device_name(¶ms, dev_name);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
config AF_RXRPC
|
config AF_RXRPC
|
||||||
tristate "RxRPC session sockets"
|
tristate "RxRPC session sockets"
|
||||||
depends on EXPERIMENTAL
|
depends on EXPERIMENTAL
|
||||||
|
select KEYS
|
||||||
help
|
help
|
||||||
Say Y or M here to include support for RxRPC session sockets (just
|
Say Y or M here to include support for RxRPC session sockets (just
|
||||||
the transport part, not the presentation part: (un)marshalling is
|
the transport part, not the presentation part: (un)marshalling is
|
||||||
@ -29,7 +30,7 @@ config AF_RXRPC_DEBUG
|
|||||||
|
|
||||||
config RXKAD
|
config RXKAD
|
||||||
tristate "RxRPC Kerberos security"
|
tristate "RxRPC Kerberos security"
|
||||||
depends on AF_RXRPC && KEYS
|
depends on AF_RXRPC
|
||||||
select CRYPTO
|
select CRYPTO
|
||||||
select CRYPTO_MANAGER
|
select CRYPTO_MANAGER
|
||||||
select CRYPTO_BLKCIPHER
|
select CRYPTO_BLKCIPHER
|
||||||
|
Loading…
Reference in New Issue
Block a user