Commit 681750c0 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-cifs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull cifs xattr updates from Al Viro:
 "This is the remaining parts of the xattr work - the cifs bits"

* 'for-cifs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  cifs: Switch to generic xattr handlers
  cifs: Fix removexattr for os2.* xattrs
  cifs: Check for equality with ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT
  cifs: Fix xattr name checks
parents 820c687b a9ae008f
...@@ -5,9 +5,10 @@ obj-$(CONFIG_CIFS) += cifs.o ...@@ -5,9 +5,10 @@ obj-$(CONFIG_CIFS) += cifs.o
cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \ cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
link.o misc.o netmisc.o smbencrypt.o transport.o asn1.o \ link.o misc.o netmisc.o smbencrypt.o transport.o asn1.o \
cifs_unicode.o nterr.o xattr.o cifsencrypt.o \ cifs_unicode.o nterr.o cifsencrypt.o \
readdir.o ioctl.o sess.o export.o smb1ops.o winucase.o readdir.o ioctl.o sess.o export.o smb1ops.o winucase.o
cifs-$(CONFIG_CIFS_XATTR) += xattr.o
cifs-$(CONFIG_CIFS_ACL) += cifsacl.o cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/namei.h> #include <linux/namei.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/xattr.h>
#include <net/ipv6.h> #include <net/ipv6.h>
#include "cifsfs.h" #include "cifsfs.h"
#include "cifspdu.h" #include "cifspdu.h"
...@@ -135,6 +136,7 @@ cifs_read_super(struct super_block *sb) ...@@ -135,6 +136,7 @@ cifs_read_super(struct super_block *sb)
sb->s_magic = CIFS_MAGIC_NUMBER; sb->s_magic = CIFS_MAGIC_NUMBER;
sb->s_op = &cifs_super_ops; sb->s_op = &cifs_super_ops;
sb->s_xattr = cifs_xattr_handlers;
sb->s_bdi = &cifs_sb->bdi; sb->s_bdi = &cifs_sb->bdi;
sb->s_blocksize = CIFS_MAX_MSGSIZE; sb->s_blocksize = CIFS_MAX_MSGSIZE;
sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */ sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */
...@@ -892,12 +894,10 @@ const struct inode_operations cifs_dir_inode_ops = { ...@@ -892,12 +894,10 @@ const struct inode_operations cifs_dir_inode_ops = {
.setattr = cifs_setattr, .setattr = cifs_setattr,
.symlink = cifs_symlink, .symlink = cifs_symlink,
.mknod = cifs_mknod, .mknod = cifs_mknod,
#ifdef CONFIG_CIFS_XATTR .setxattr = generic_setxattr,
.setxattr = cifs_setxattr, .getxattr = generic_getxattr,
.getxattr = cifs_getxattr,
.listxattr = cifs_listxattr, .listxattr = cifs_listxattr,
.removexattr = cifs_removexattr, .removexattr = generic_removexattr,
#endif
}; };
const struct inode_operations cifs_file_inode_ops = { const struct inode_operations cifs_file_inode_ops = {
...@@ -905,12 +905,10 @@ const struct inode_operations cifs_file_inode_ops = { ...@@ -905,12 +905,10 @@ const struct inode_operations cifs_file_inode_ops = {
.setattr = cifs_setattr, .setattr = cifs_setattr,
.getattr = cifs_getattr, /* do we need this anymore? */ .getattr = cifs_getattr, /* do we need this anymore? */
.permission = cifs_permission, .permission = cifs_permission,
#ifdef CONFIG_CIFS_XATTR .setxattr = generic_setxattr,
.setxattr = cifs_setxattr, .getxattr = generic_getxattr,
.getxattr = cifs_getxattr,
.listxattr = cifs_listxattr, .listxattr = cifs_listxattr,
.removexattr = cifs_removexattr, .removexattr = generic_removexattr,
#endif
}; };
const struct inode_operations cifs_symlink_inode_ops = { const struct inode_operations cifs_symlink_inode_ops = {
...@@ -920,12 +918,10 @@ const struct inode_operations cifs_symlink_inode_ops = { ...@@ -920,12 +918,10 @@ const struct inode_operations cifs_symlink_inode_ops = {
/* BB add the following two eventually */ /* BB add the following two eventually */
/* revalidate: cifs_revalidate, /* revalidate: cifs_revalidate,
setattr: cifs_notify_change, *//* BB do we need notify change */ setattr: cifs_notify_change, *//* BB do we need notify change */
#ifdef CONFIG_CIFS_XATTR .setxattr = generic_setxattr,
.setxattr = cifs_setxattr, .getxattr = generic_getxattr,
.getxattr = cifs_getxattr,
.listxattr = cifs_listxattr, .listxattr = cifs_listxattr,
.removexattr = cifs_removexattr, .removexattr = generic_removexattr,
#endif
}; };
static int cifs_clone_file_range(struct file *src_file, loff_t off, static int cifs_clone_file_range(struct file *src_file, loff_t off,
......
...@@ -120,11 +120,15 @@ extern const char *cifs_get_link(struct dentry *, struct inode *, ...@@ -120,11 +120,15 @@ extern const char *cifs_get_link(struct dentry *, struct inode *,
struct delayed_call *); struct delayed_call *);
extern int cifs_symlink(struct inode *inode, struct dentry *direntry, extern int cifs_symlink(struct inode *inode, struct dentry *direntry,
const char *symname); const char *symname);
extern int cifs_removexattr(struct dentry *, const char *);
extern int cifs_setxattr(struct dentry *, const char *, const void *, #ifdef CONFIG_CIFS_XATTR
size_t, int); extern const struct xattr_handler *cifs_xattr_handlers[];
extern ssize_t cifs_getxattr(struct dentry *, struct inode *, const char *, void *, size_t);
extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
#else
# define cifs_xattr_handlers NULL
# define cifs_listxattr NULL
#endif
extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
#ifdef CONFIG_CIFS_NFSD_EXPORT #ifdef CONFIG_CIFS_NFSD_EXPORT
extern const struct export_operations cifs_export_ops; extern const struct export_operations cifs_export_ops;
......
...@@ -3366,7 +3366,7 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen, ...@@ -3366,7 +3366,7 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen,
if (le16_to_cpu(cifs_acl->version) != CIFS_ACL_VERSION) if (le16_to_cpu(cifs_acl->version) != CIFS_ACL_VERSION)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (acl_type & ACL_TYPE_ACCESS) { if (acl_type == ACL_TYPE_ACCESS) {
count = le16_to_cpu(cifs_acl->access_entry_count); count = le16_to_cpu(cifs_acl->access_entry_count);
pACE = &cifs_acl->ace_array[0]; pACE = &cifs_acl->ace_array[0];
size = sizeof(struct cifs_posix_acl); size = sizeof(struct cifs_posix_acl);
...@@ -3377,7 +3377,7 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen, ...@@ -3377,7 +3377,7 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen,
size_of_data_area, size); size_of_data_area, size);
return -EINVAL; return -EINVAL;
} }
} else if (acl_type & ACL_TYPE_DEFAULT) { } else if (acl_type == ACL_TYPE_DEFAULT) {
count = le16_to_cpu(cifs_acl->access_entry_count); count = le16_to_cpu(cifs_acl->access_entry_count);
size = sizeof(struct cifs_posix_acl); size = sizeof(struct cifs_posix_acl);
size += sizeof(struct cifs_posix_ace) * count; size += sizeof(struct cifs_posix_ace) * count;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment