diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/acl.c | 4 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 11 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 5 | ||||
-rw-r--r-- | fs/btrfs/super.c | 5 | ||||
-rw-r--r-- | fs/btrfs/xattr.c | 2 | ||||
-rw-r--r-- | fs/btrfs/xattr.h | 6 |
7 files changed, 17 insertions, 18 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 6ef7b26724ec..8d432cd9d580 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -282,14 +282,14 @@ int btrfs_acl_chmod(struct inode *inode) | |||
282 | return ret; | 282 | return ret; |
283 | } | 283 | } |
284 | 284 | ||
285 | struct xattr_handler btrfs_xattr_acl_default_handler = { | 285 | const struct xattr_handler btrfs_xattr_acl_default_handler = { |
286 | .prefix = POSIX_ACL_XATTR_DEFAULT, | 286 | .prefix = POSIX_ACL_XATTR_DEFAULT, |
287 | .flags = ACL_TYPE_DEFAULT, | 287 | .flags = ACL_TYPE_DEFAULT, |
288 | .get = btrfs_xattr_acl_get, | 288 | .get = btrfs_xattr_acl_get, |
289 | .set = btrfs_xattr_acl_set, | 289 | .set = btrfs_xattr_acl_set, |
290 | }; | 290 | }; |
291 | 291 | ||
292 | struct xattr_handler btrfs_xattr_acl_access_handler = { | 292 | const struct xattr_handler btrfs_xattr_acl_access_handler = { |
293 | .prefix = POSIX_ACL_XATTR_ACCESS, | 293 | .prefix = POSIX_ACL_XATTR_ACCESS, |
294 | .flags = ACL_TYPE_ACCESS, | 294 | .flags = ACL_TYPE_ACCESS, |
295 | .get = btrfs_xattr_acl_get, | 295 | .get = btrfs_xattr_acl_get, |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index b34d32fdaaec..c6a4f459ad76 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -1589,7 +1589,7 @@ static void btrfs_issue_discard(struct block_device *bdev, | |||
1589 | u64 start, u64 len) | 1589 | u64 start, u64 len) |
1590 | { | 1590 | { |
1591 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, | 1591 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, |
1592 | DISCARD_FL_BARRIER); | 1592 | BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); |
1593 | } | 1593 | } |
1594 | 1594 | ||
1595 | static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, | 1595 | static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 2bfdc641d4e3..d601629b85d1 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4121,16 +4121,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
4121 | if (ret != 0) | 4121 | if (ret != 0) |
4122 | goto fail; | 4122 | goto fail; |
4123 | 4123 | ||
4124 | inode->i_uid = current_fsuid(); | 4124 | inode_init_owner(inode, dir, mode); |
4125 | |||
4126 | if (dir && (dir->i_mode & S_ISGID)) { | ||
4127 | inode->i_gid = dir->i_gid; | ||
4128 | if (S_ISDIR(mode)) | ||
4129 | mode |= S_ISGID; | ||
4130 | } else | ||
4131 | inode->i_gid = current_fsgid(); | ||
4132 | |||
4133 | inode->i_mode = mode; | ||
4134 | inode->i_ino = objectid; | 4125 | inode->i_ino = objectid; |
4135 | inode_set_bytes(inode, 0); | 4126 | inode_set_bytes(inode, 0); |
4136 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 4127 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e84ef60ffe35..97a97839a867 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -1481,12 +1481,17 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | |||
1481 | ret = -EBADF; | 1481 | ret = -EBADF; |
1482 | goto out_drop_write; | 1482 | goto out_drop_write; |
1483 | } | 1483 | } |
1484 | |||
1484 | src = src_file->f_dentry->d_inode; | 1485 | src = src_file->f_dentry->d_inode; |
1485 | 1486 | ||
1486 | ret = -EINVAL; | 1487 | ret = -EINVAL; |
1487 | if (src == inode) | 1488 | if (src == inode) |
1488 | goto out_fput; | 1489 | goto out_fput; |
1489 | 1490 | ||
1491 | /* the src must be open for reading */ | ||
1492 | if (!(src_file->f_mode & FMODE_READ)) | ||
1493 | goto out_fput; | ||
1494 | |||
1490 | ret = -EISDIR; | 1495 | ret = -EISDIR; |
1491 | if (S_ISDIR(src->i_mode) || S_ISDIR(inode->i_mode)) | 1496 | if (S_ISDIR(src->i_mode) || S_ISDIR(inode->i_mode)) |
1492 | goto out_fput; | 1497 | goto out_fput; |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 1866dff0538e..2909a03e5230 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -832,11 +832,14 @@ static const struct file_operations btrfs_ctl_fops = { | |||
832 | }; | 832 | }; |
833 | 833 | ||
834 | static struct miscdevice btrfs_misc = { | 834 | static struct miscdevice btrfs_misc = { |
835 | .minor = MISC_DYNAMIC_MINOR, | 835 | .minor = BTRFS_MINOR, |
836 | .name = "btrfs-control", | 836 | .name = "btrfs-control", |
837 | .fops = &btrfs_ctl_fops | 837 | .fops = &btrfs_ctl_fops |
838 | }; | 838 | }; |
839 | 839 | ||
840 | MODULE_ALIAS_MISCDEV(BTRFS_MINOR); | ||
841 | MODULE_ALIAS("devname:btrfs-control"); | ||
842 | |||
840 | static int btrfs_interface_init(void) | 843 | static int btrfs_interface_init(void) |
841 | { | 844 | { |
842 | return misc_register(&btrfs_misc); | 845 | return misc_register(&btrfs_misc); |
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 193b58f7d3f3..59acd3eb288a 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c | |||
@@ -282,7 +282,7 @@ err: | |||
282 | * List of handlers for synthetic system.* attributes. All real ondisk | 282 | * List of handlers for synthetic system.* attributes. All real ondisk |
283 | * attributes are handled directly. | 283 | * attributes are handled directly. |
284 | */ | 284 | */ |
285 | struct xattr_handler *btrfs_xattr_handlers[] = { | 285 | const struct xattr_handler *btrfs_xattr_handlers[] = { |
286 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL | 286 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL |
287 | &btrfs_xattr_acl_access_handler, | 287 | &btrfs_xattr_acl_access_handler, |
288 | &btrfs_xattr_acl_default_handler, | 288 | &btrfs_xattr_acl_default_handler, |
diff --git a/fs/btrfs/xattr.h b/fs/btrfs/xattr.h index 721efa0346e0..7a43fd640bbb 100644 --- a/fs/btrfs/xattr.h +++ b/fs/btrfs/xattr.h | |||
@@ -21,9 +21,9 @@ | |||
21 | 21 | ||
22 | #include <linux/xattr.h> | 22 | #include <linux/xattr.h> |
23 | 23 | ||
24 | extern struct xattr_handler btrfs_xattr_acl_access_handler; | 24 | extern const struct xattr_handler btrfs_xattr_acl_access_handler; |
25 | extern struct xattr_handler btrfs_xattr_acl_default_handler; | 25 | extern const struct xattr_handler btrfs_xattr_acl_default_handler; |
26 | extern struct xattr_handler *btrfs_xattr_handlers[]; | 26 | extern const struct xattr_handler *btrfs_xattr_handlers[]; |
27 | 27 | ||
28 | extern ssize_t __btrfs_getxattr(struct inode *inode, const char *name, | 28 | extern ssize_t __btrfs_getxattr(struct inode *inode, const char *name, |
29 | void *buffer, size_t size); | 29 | void *buffer, size_t size); |