Merge 051c3556e3 ("Merge tag 'for_v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs") into android-mainline
Small steps on the way to 5.8-rc1 Change-Id: I664ad93f8264c07f34ac1fefb4046d879e6129ed Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -196,9 +196,7 @@ const struct file_operations ext2_file_operations = {
|
||||
};
|
||||
|
||||
const struct inode_operations ext2_file_inode_operations = {
|
||||
#ifdef CONFIG_EXT2_FS_XATTR
|
||||
.listxattr = ext2_listxattr,
|
||||
#endif
|
||||
.getattr = ext2_getattr,
|
||||
.setattr = ext2_setattr,
|
||||
.get_acl = ext2_get_acl,
|
||||
|
||||
@@ -136,9 +136,7 @@ static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode,
|
||||
err = PTR_ERR(inode);
|
||||
if (!IS_ERR(inode)) {
|
||||
init_special_inode(inode, inode->i_mode, rdev);
|
||||
#ifdef CONFIG_EXT2_FS_XATTR
|
||||
inode->i_op = &ext2_special_inode_operations;
|
||||
#endif
|
||||
mark_inode_dirty(inode);
|
||||
err = ext2_add_nondir(dentry, inode);
|
||||
}
|
||||
@@ -413,9 +411,7 @@ const struct inode_operations ext2_dir_inode_operations = {
|
||||
.rmdir = ext2_rmdir,
|
||||
.mknod = ext2_mknod,
|
||||
.rename = ext2_rename,
|
||||
#ifdef CONFIG_EXT2_FS_XATTR
|
||||
.listxattr = ext2_listxattr,
|
||||
#endif
|
||||
.getattr = ext2_getattr,
|
||||
.setattr = ext2_setattr,
|
||||
.get_acl = ext2_get_acl,
|
||||
@@ -424,9 +420,7 @@ const struct inode_operations ext2_dir_inode_operations = {
|
||||
};
|
||||
|
||||
const struct inode_operations ext2_special_inode_operations = {
|
||||
#ifdef CONFIG_EXT2_FS_XATTR
|
||||
.listxattr = ext2_listxattr,
|
||||
#endif
|
||||
.getattr = ext2_getattr,
|
||||
.setattr = ext2_setattr,
|
||||
.get_acl = ext2_get_acl,
|
||||
|
||||
@@ -25,16 +25,12 @@ const struct inode_operations ext2_symlink_inode_operations = {
|
||||
.get_link = page_get_link,
|
||||
.getattr = ext2_getattr,
|
||||
.setattr = ext2_setattr,
|
||||
#ifdef CONFIG_EXT2_FS_XATTR
|
||||
.listxattr = ext2_listxattr,
|
||||
#endif
|
||||
};
|
||||
|
||||
const struct inode_operations ext2_fast_symlink_inode_operations = {
|
||||
.get_link = simple_get_link,
|
||||
.getattr = ext2_getattr,
|
||||
.setattr = ext2_setattr,
|
||||
#ifdef CONFIG_EXT2_FS_XATTR
|
||||
.listxattr = ext2_listxattr,
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -100,6 +100,7 @@ static inline void ext2_xattr_destroy_cache(struct mb_cache *cache)
|
||||
}
|
||||
|
||||
#define ext2_xattr_handlers NULL
|
||||
#define ext2_listxattr NULL
|
||||
|
||||
# endif /* CONFIG_EXT2_FS_XATTR */
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ static bool fanotify_name_event_equal(struct fanotify_name_event *fne1,
|
||||
return !memcmp(fne1->name, fne2->name, fne1->name_len);
|
||||
}
|
||||
|
||||
static bool should_merge(struct fsnotify_event *old_fsn,
|
||||
static bool fanotify_should_merge(struct fsnotify_event *old_fsn,
|
||||
struct fsnotify_event *new_fsn)
|
||||
{
|
||||
struct fanotify_event *old, *new;
|
||||
@@ -129,7 +129,7 @@ static int fanotify_merge(struct list_head *list, struct fsnotify_event *event)
|
||||
return 0;
|
||||
|
||||
list_for_each_entry_reverse(test_event, list, list) {
|
||||
if (should_merge(test_event, event)) {
|
||||
if (fanotify_should_merge(test_event, event)) {
|
||||
FANOTIFY_E(test_event)->mask |= new->mask;
|
||||
return 1;
|
||||
}
|
||||
@@ -232,6 +232,10 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group,
|
||||
if (!fsnotify_iter_should_report_type(iter_info, type))
|
||||
continue;
|
||||
mark = iter_info->marks[type];
|
||||
|
||||
/* Apply ignore mask regardless of ISDIR and ON_CHILD flags */
|
||||
marks_ignored_mask |= mark->ignored_mask;
|
||||
|
||||
/*
|
||||
* If the event is on dir and this mark doesn't care about
|
||||
* events on dir, don't send it!
|
||||
@@ -249,7 +253,6 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group,
|
||||
continue;
|
||||
|
||||
marks_mask |= mark->mask;
|
||||
marks_ignored_mask |= mark->ignored_mask;
|
||||
}
|
||||
|
||||
test_mask = event_mask & marks_mask & ~marks_ignored_mask;
|
||||
|
||||
@@ -89,7 +89,7 @@ struct fanotify_name_event {
|
||||
__kernel_fsid_t fsid;
|
||||
struct fanotify_fh dir_fh;
|
||||
u8 name_len;
|
||||
char name[0];
|
||||
char name[];
|
||||
};
|
||||
|
||||
static inline struct fanotify_name_event *
|
||||
|
||||
@@ -328,7 +328,7 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
|
||||
ret = -EFAULT;
|
||||
/*
|
||||
* Sanity check copy size in case get_one_event() and
|
||||
* fill_event_metadata() event_len sizes ever get out of sync.
|
||||
* event_len sizes ever get out of sync.
|
||||
*/
|
||||
if (WARN_ON_ONCE(metadata.event_len > count))
|
||||
goto out_close_fd;
|
||||
@@ -487,8 +487,10 @@ static ssize_t fanotify_write(struct file *file, const char __user *buf, size_t
|
||||
|
||||
group = file->private_data;
|
||||
|
||||
if (count > sizeof(response))
|
||||
count = sizeof(response);
|
||||
if (count < sizeof(response))
|
||||
return -EINVAL;
|
||||
|
||||
count = sizeof(response);
|
||||
|
||||
pr_debug("%s: group=%p count=%zu\n", __func__, group, count);
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/exportfs.h>
|
||||
|
||||
#include "inotify/inotify.h"
|
||||
|
||||
@@ -25,6 +25,7 @@ static void fsnotify_final_destroy_group(struct fsnotify_group *group)
|
||||
group->ops->free_group_priv(group);
|
||||
|
||||
mem_cgroup_put(group->memcg);
|
||||
mutex_destroy(&group->mark_mutex);
|
||||
|
||||
kfree(group);
|
||||
}
|
||||
|
||||
@@ -764,20 +764,18 @@ SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd)
|
||||
struct fsnotify_group *group;
|
||||
struct inotify_inode_mark *i_mark;
|
||||
struct fd f;
|
||||
int ret = 0;
|
||||
int ret = -EINVAL;
|
||||
|
||||
f = fdget(fd);
|
||||
if (unlikely(!f.file))
|
||||
return -EBADF;
|
||||
|
||||
/* verify that this is indeed an inotify instance */
|
||||
ret = -EINVAL;
|
||||
if (unlikely(f.file->f_op != &inotify_fops))
|
||||
goto out;
|
||||
|
||||
group = f.file->private_data;
|
||||
|
||||
ret = -EINVAL;
|
||||
i_mark = inotify_idr_find(group, wd);
|
||||
if (unlikely(!i_mark))
|
||||
goto out;
|
||||
|
||||
+5
-1
@@ -325,13 +325,16 @@ static void fsnotify_put_mark_wake(struct fsnotify_mark *mark)
|
||||
}
|
||||
|
||||
bool fsnotify_prepare_user_wait(struct fsnotify_iter_info *iter_info)
|
||||
__releases(&fsnotify_mark_srcu)
|
||||
{
|
||||
int type;
|
||||
|
||||
fsnotify_foreach_obj_type(type) {
|
||||
/* This can fail if mark is being removed */
|
||||
if (!fsnotify_get_mark_safe(iter_info->marks[type]))
|
||||
if (!fsnotify_get_mark_safe(iter_info->marks[type])) {
|
||||
__release(&fsnotify_mark_srcu);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -350,6 +353,7 @@ fail:
|
||||
}
|
||||
|
||||
void fsnotify_finish_user_wait(struct fsnotify_iter_info *iter_info)
|
||||
__acquires(&fsnotify_mark_srcu)
|
||||
{
|
||||
int type;
|
||||
|
||||
|
||||
+1
-1
@@ -1066,7 +1066,7 @@ research:
|
||||
} else {
|
||||
/* paste hole to the indirect item */
|
||||
/*
|
||||
* If kmalloc failed, max_to_insert becomes
|
||||
* If kcalloc failed, max_to_insert becomes
|
||||
* zero and it means we only have space for
|
||||
* one block
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user