forked from grate-driver/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'for-linus-3.11-merge-window-part-2' of git://git.kernel.or…
…g/pub/scm/linux/kernel/git/ericvh/v9fs Pull second round of 9p patches from Eric Van Hensbergen: "Several of these patches were rebased in order to correct style issues. Only stylistic changes were made versus the patches which were in linux-next for two weeks. The rebases have been in linux-next for 3 days and have passed my regressions. The bulk of these are RDMA fixes and improvements. There's also some additions on the extended attributes front to support some additional namespaces and a new option for TCP to force allocation of mount requests from a priviledged port" * tag 'for-linus-3.11-merge-window-part-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs: fs/9p: Remove the unused variable "err" in v9fs_vfs_getattr() 9P: Add cancelled() to the transport functions. 9P/RDMA: count posted buffers without a pending request 9P/RDMA: Improve error handling in rdma_request 9P/RDMA: Do not free req->rc in error handling in rdma_request() 9P/RDMA: Use a semaphore to protect the RQ 9P/RDMA: Protect against duplicate replies 9P/RDMA: increase P9_RDMA_MAXSIZE to 1MB 9pnet: refactor struct p9_fcall alloc code 9P/RDMA: rdma_request() needs not allocate req->rc 9P: Fix fcall allocation for rdma fs/9p: xattr: add trusted and security namespaces net/9p: add privport option to 9p tcp transport
- Loading branch information
Showing
11 changed files
with
355 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright IBM Corporation, 2010 | ||
* Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of version 2.1 of the GNU Lesser General Public License | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it would be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* | ||
*/ | ||
|
||
|
||
#include <linux/module.h> | ||
#include <linux/string.h> | ||
#include <linux/fs.h> | ||
#include <linux/slab.h> | ||
#include "xattr.h" | ||
|
||
static int v9fs_xattr_security_get(struct dentry *dentry, const char *name, | ||
void *buffer, size_t size, int type) | ||
{ | ||
int retval; | ||
char *full_name; | ||
size_t name_len; | ||
size_t prefix_len = XATTR_SECURITY_PREFIX_LEN; | ||
|
||
if (name == NULL) | ||
return -EINVAL; | ||
|
||
if (strcmp(name, "") == 0) | ||
return -EINVAL; | ||
|
||
name_len = strlen(name); | ||
full_name = kmalloc(prefix_len + name_len + 1 , GFP_KERNEL); | ||
if (!full_name) | ||
return -ENOMEM; | ||
memcpy(full_name, XATTR_SECURITY_PREFIX, prefix_len); | ||
memcpy(full_name+prefix_len, name, name_len); | ||
full_name[prefix_len + name_len] = '\0'; | ||
|
||
retval = v9fs_xattr_get(dentry, full_name, buffer, size); | ||
kfree(full_name); | ||
return retval; | ||
} | ||
|
||
static int v9fs_xattr_security_set(struct dentry *dentry, const char *name, | ||
const void *value, size_t size, int flags, int type) | ||
{ | ||
int retval; | ||
char *full_name; | ||
size_t name_len; | ||
size_t prefix_len = XATTR_SECURITY_PREFIX_LEN; | ||
|
||
if (name == NULL) | ||
return -EINVAL; | ||
|
||
if (strcmp(name, "") == 0) | ||
return -EINVAL; | ||
|
||
name_len = strlen(name); | ||
full_name = kmalloc(prefix_len + name_len + 1 , GFP_KERNEL); | ||
if (!full_name) | ||
return -ENOMEM; | ||
memcpy(full_name, XATTR_SECURITY_PREFIX, prefix_len); | ||
memcpy(full_name + prefix_len, name, name_len); | ||
full_name[prefix_len + name_len] = '\0'; | ||
|
||
retval = v9fs_xattr_set(dentry, full_name, value, size, flags); | ||
kfree(full_name); | ||
return retval; | ||
} | ||
|
||
struct xattr_handler v9fs_xattr_security_handler = { | ||
.prefix = XATTR_SECURITY_PREFIX, | ||
.get = v9fs_xattr_security_get, | ||
.set = v9fs_xattr_security_set, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright IBM Corporation, 2010 | ||
* Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of version 2.1 of the GNU Lesser General Public License | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it would be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* | ||
*/ | ||
|
||
|
||
#include <linux/module.h> | ||
#include <linux/string.h> | ||
#include <linux/fs.h> | ||
#include <linux/slab.h> | ||
#include "xattr.h" | ||
|
||
static int v9fs_xattr_trusted_get(struct dentry *dentry, const char *name, | ||
void *buffer, size_t size, int type) | ||
{ | ||
int retval; | ||
char *full_name; | ||
size_t name_len; | ||
size_t prefix_len = XATTR_TRUSTED_PREFIX_LEN; | ||
|
||
if (name == NULL) | ||
return -EINVAL; | ||
|
||
if (strcmp(name, "") == 0) | ||
return -EINVAL; | ||
|
||
name_len = strlen(name); | ||
full_name = kmalloc(prefix_len + name_len + 1 , GFP_KERNEL); | ||
if (!full_name) | ||
return -ENOMEM; | ||
memcpy(full_name, XATTR_TRUSTED_PREFIX, prefix_len); | ||
memcpy(full_name+prefix_len, name, name_len); | ||
full_name[prefix_len + name_len] = '\0'; | ||
|
||
retval = v9fs_xattr_get(dentry, full_name, buffer, size); | ||
kfree(full_name); | ||
return retval; | ||
} | ||
|
||
static int v9fs_xattr_trusted_set(struct dentry *dentry, const char *name, | ||
const void *value, size_t size, int flags, int type) | ||
{ | ||
int retval; | ||
char *full_name; | ||
size_t name_len; | ||
size_t prefix_len = XATTR_TRUSTED_PREFIX_LEN; | ||
|
||
if (name == NULL) | ||
return -EINVAL; | ||
|
||
if (strcmp(name, "") == 0) | ||
return -EINVAL; | ||
|
||
name_len = strlen(name); | ||
full_name = kmalloc(prefix_len + name_len + 1 , GFP_KERNEL); | ||
if (!full_name) | ||
return -ENOMEM; | ||
memcpy(full_name, XATTR_TRUSTED_PREFIX, prefix_len); | ||
memcpy(full_name + prefix_len, name, name_len); | ||
full_name[prefix_len + name_len] = '\0'; | ||
|
||
retval = v9fs_xattr_set(dentry, full_name, value, size, flags); | ||
kfree(full_name); | ||
return retval; | ||
} | ||
|
||
struct xattr_handler v9fs_xattr_trusted_handler = { | ||
.prefix = XATTR_TRUSTED_PREFIX, | ||
.get = v9fs_xattr_trusted_get, | ||
.set = v9fs_xattr_trusted_set, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.