-aufs4.11.7+ kbuild patch
+aufs4.x-rcN kbuild patch
diff --git a/fs/Kconfig b/fs/Kconfig
-index 83eab52..31f16c4 100644
+index 7aee6d6..ec92031 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -248,6 +248,7 @@ source "fs/pstore/Kconfig"
obj-$(CONFIG_PSTORE) += pstore/
obj-$(CONFIG_EFIVAR_FS) += efivarfs/
+obj-$(CONFIG_AUFS_FS) += aufs/
-diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
-index f8d9fed..902305e 100644
---- a/include/uapi/linux/Kbuild
-+++ b/include/uapi/linux/Kbuild
-@@ -59,6 +59,7 @@ header-y += atmsvc.h
- header-y += atm_tcp.h
- header-y += atm_zatm.h
- header-y += audit.h
-+header-y += aufs_type.h
- header-y += auto_fs4.h
- header-y += auto_fs.h
- header-y += auxvec.h
-aufs4.11.7+ base patch
+aufs4.x-rcN base patch
diff --git a/MAINTAINERS b/MAINTAINERS
-index 38d3e4e..c2b31bf 100644
+index 1c3feff..1a12137 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
-@@ -2319,6 +2319,19 @@ F: include/linux/audit.h
+@@ -2392,6 +2392,19 @@ F: include/linux/audit.h
F: include/uapi/linux/audit.h
F: kernel/audit*
M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
W: http://miguelojeda.es/auxdisplay.htm
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index 0ecb646..cf39138 100644
+index f321b96..10707c3 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
-@@ -701,6 +701,24 @@ static inline int is_loop_device(struct file *file)
+@@ -700,6 +700,24 @@ static inline int is_loop_device(struct file *file)
return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR;
}
static ssize_t loop_attr_show(struct device *dev, char *page,
diff --git a/fs/dcache.c b/fs/dcache.c
-index 95d71ed..8ca5f09 100644
+index f901413..e3719a5 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
-@@ -1164,7 +1164,7 @@ enum d_walk_ret {
+@@ -1197,7 +1197,7 @@ enum d_walk_ret {
*
* The @enter() and @finish() callbacks are called with d_lock held.
*/
void (*finish)(void *))
{
diff --git a/fs/fcntl.c b/fs/fcntl.c
-index be8fbe2..f5f4f94 100644
+index 3b01b64..659760e 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
-@@ -30,7 +30,7 @@
+@@ -31,7 +31,7 @@
#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
{
struct inode * inode = file_inode(filp);
int error = 0;
-@@ -61,6 +61,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
+@@ -62,6 +62,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
if (filp->f_op->check_flags)
error = filp->f_op->check_flags(arg);
return error;
diff --git a/fs/inode.c b/fs/inode.c
-index 88110fd..9a9ba3a 100644
+index 5037059..73820bf 100644
--- a/fs/inode.c
+++ b/fs/inode.c
-@@ -1642,7 +1642,7 @@ EXPORT_SYMBOL(generic_update_time);
+@@ -1641,7 +1641,7 @@ EXPORT_SYMBOL(generic_update_time);
* This does the actual work of updating an inodes time or version. Must have
* had called mnt_want_write() before calling this.
*/
int (*update_time)(struct inode *, struct timespec *, int);
diff --git a/fs/read_write.c b/fs/read_write.c
-index f77eb22..eba4e7e 100644
+index 0cc7033..6e542f0 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
-@@ -513,6 +513,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
+@@ -473,6 +473,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
}
EXPORT_SYMBOL(__vfs_write);
{
mm_segment_t old_fs;
diff --git a/fs/splice.c b/fs/splice.c
-index 006ba50..46c87af 100644
+index ae41201..9753304 100644
--- a/fs/splice.c
+++ b/fs/splice.c
-@@ -859,8 +859,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
+@@ -853,8 +853,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
/*
* Attempt to initiate a splice from pipe to file.
*/
{
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
loff_t *, size_t, unsigned int);
-@@ -876,9 +876,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -870,9 +870,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
/*
* Attempt to initiate a splice from a file to a pipe.
*/
ssize_t (*splice_read)(struct file *, loff_t *,
struct pipe_inode_info *, size_t, unsigned int);
diff --git a/fs/sync.c b/fs/sync.c
-index 11ba023..abf6a5d 100644
+index 2a54c1f..7a5fa3f 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -27,7 +27,7 @@
static inline void fput_light(struct file *file, int fput_needed)
{
diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 7415630..433e314 100644
+index cbfe127..9b21bb5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -1246,6 +1246,7 @@ extern void fasync_free(struct fasync_struct *);
+@@ -1262,6 +1262,7 @@ extern void fasync_free(struct fasync_struct *);
/* can be called from interrupts */
extern void kill_fasync(struct fasync_struct **, int, int);
+extern int setfl(int fd, struct file * filp, unsigned long arg);
extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
- extern void f_setown(struct file *filp, unsigned long arg, int force);
+ extern int f_setown(struct file *filp, unsigned long arg, int force);
extern void f_delown(struct file *filp);
-@@ -1673,6 +1674,7 @@ struct file_operations {
+@@ -1683,6 +1684,7 @@ struct file_operations {
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
int (*flock) (struct file *, int, struct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
-@@ -1749,6 +1751,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
+@@ -1753,6 +1755,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
struct iovec *fast_pointer,
struct iovec **ret_pointer);
extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *);
extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
-@@ -2127,6 +2135,7 @@ extern int current_umask(void);
+@@ -2157,6 +2165,7 @@ extern int current_umask(void);
extern void ihold(struct inode * inode);
extern void iput(struct inode *);
extern int generic_update_time(struct inode *, struct timespec *, int);
/* /sys/fs */
extern struct kobject *fs_kobj;
-@@ -2407,6 +2416,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
+@@ -2437,6 +2446,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
return false;
}
#endif
extern const struct file_operations def_blk_fops;
extern const struct file_operations def_chr_fops;
diff --git a/include/linux/splice.h b/include/linux/splice.h
-index 00a2116..1f0a4a2 100644
+index db42746..12f3a5a 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
-@@ -86,4 +86,10 @@ extern void spd_release_page(struct splice_pipe_desc *, unsigned int);
+@@ -86,4 +86,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
extern const struct pipe_buf_operations default_pipe_buf_ops;
+ struct pipe_inode_info *pipe, size_t len,
+ unsigned int flags);
#endif
-aufs4.11.7+ mmap patch
+aufs4.x-rcN mmap patch
diff --git a/fs/proc/base.c b/fs/proc/base.c
-index c87b6b9..6b71643 100644
+index 719c2e9..a1b7968 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
-@@ -1946,7 +1946,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
+@@ -1986,7 +1986,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
down_read(&mm->mmap_sem);
vma = find_exact_vma(mm, vm_start, vm_end);
if (vma && vma->vm_file) {
ino = inode->i_ino;
}
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index f401682..79ea96a 100644
+index fe8f326..b2f7f1a 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
-@@ -292,7 +292,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
+@@ -293,7 +293,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
const char *name = NULL;
if (file) {
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
-@@ -1632,7 +1635,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
+@@ -1640,7 +1643,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
struct proc_maps_private *proc_priv = &numa_priv->proc_maps;
struct vm_area_struct *vma = v;
struct numa_maps *md = &numa_priv->md;
ino = inode->i_ino;
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
diff --git a/include/linux/mm.h b/include/linux/mm.h
-index cec423b..b6b2f901 100644
+index 46b9ac5..62ba1c3 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
-@@ -1294,6 +1294,28 @@ static inline int fixup_user_fault(struct task_struct *tsk,
+@@ -1306,6 +1306,28 @@ static inline int fixup_user_fault(struct task_struct *tsk,
}
#endif
unsigned int gup_flags);
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index f60f45f..38c5f76 100644
+index 3cadee0..d0142c1 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -259,6 +259,7 @@ struct vm_region {
#ifndef CONFIG_MMU
diff --git a/kernel/fork.c b/kernel/fork.c
-index 4f7151d..ebe8415 100644
+index cbbea27..f0fd8a1 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -641,7 +641,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
+@@ -663,7 +663,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
struct inode *inode = file_inode(file);
struct address_space *mapping = file->f_mapping;
atomic_dec(&inode->i_writecount);
i_mmap_lock_write(mapping);
diff --git a/mm/Makefile b/mm/Makefile
-index 026f6a8..723da17 100644
+index 411bd24..e7de927 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -39,7 +39,7 @@ obj-y := filemap.o mempool.o oom_kill.o \
obj-y += init-mm.o
diff --git a/mm/filemap.c b/mm/filemap.c
-index 157c047..0cf15d2 100644
+index 0b41c8c..c5262ff 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
-@@ -2406,7 +2406,7 @@ int filemap_page_mkwrite(struct vm_fault *vmf)
+@@ -2543,7 +2543,7 @@ int filemap_page_mkwrite(struct vm_fault *vmf)
int ret = VM_FAULT_LOCKED;
sb_start_pagefault(inode->i_sb);
if (page->mapping != inode->i_mapping) {
unlock_page(page);
diff --git a/mm/mmap.c b/mm/mmap.c
-index cde1262..72ca169 100644
+index f19efcf..7fdd59e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -170,7 +170,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
/* Undo any partial mapping done by a device driver. */
unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
-@@ -2571,7 +2571,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2568,7 +2568,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
goto out_free_mpol;
if (new->vm_file)
if (new->vm_ops && new->vm_ops->open)
new->vm_ops->open(new);
-@@ -2590,7 +2590,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2587,7 +2587,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
if (new->vm_ops && new->vm_ops->close)
new->vm_ops->close(new);
if (new->vm_file)
unlink_anon_vmas(new);
out_free_mpol:
mpol_put(vma_policy(new));
-@@ -2744,7 +2744,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+@@ -2741,7 +2741,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
struct vm_area_struct *vma;
unsigned long populate = 0;
unsigned long ret = -EINVAL;
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt.\n",
current->comm, current->pid);
-@@ -2819,10 +2819,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+@@ -2816,10 +2816,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
}
}
out:
up_write(&mm->mmap_sem);
if (populate)
-@@ -3113,7 +3130,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+@@ -3110,7 +3127,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
if (anon_vma_clone(new_vma, vma))
goto out_free_mempol;
if (new_vma->vm_file)
new_vma->vm_ops->open(new_vma);
vma_link(mm, new_vma, prev, rb_link, rb_parent);
diff --git a/mm/nommu.c b/mm/nommu.c
-index 2d131b9..5dc9a19 100644
+index fc184f5..637ea81 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
-@@ -637,7 +637,7 @@ static void __put_nommu_region(struct vm_region *region)
+@@ -641,7 +641,7 @@ static void __put_nommu_region(struct vm_region *region)
up_write(&nommu_region_sem);
if (region->vm_file)
/* IO memory and memory shared directly out of the pagecache
* from ramfs/tmpfs mustn't be released here */
-@@ -795,7 +795,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
+@@ -799,7 +799,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
put_nommu_region(vma->vm_region);
kmem_cache_free(vm_area_cachep, vma);
}
-@@ -1322,7 +1322,7 @@ unsigned long do_mmap(struct file *file,
+@@ -1326,7 +1326,7 @@ unsigned long do_mmap(struct file *file,
goto error_just_free;
}
}
kmem_cache_free(vm_region_jar, region);
region = pregion;
result = start;
-@@ -1397,10 +1397,10 @@ unsigned long do_mmap(struct file *file,
+@@ -1401,10 +1401,10 @@ unsigned long do_mmap(struct file *file,
up_write(&nommu_region_sem);
error:
if (region->vm_file)
+ fput(pr);
+}
+#endif /* !CONFIG_MMU */
-aufs4.11.7+ standalone patch
+aufs4.x-rcN standalone patch
diff --git a/fs/dcache.c b/fs/dcache.c
-index 8ca5f09..b1ff5be 100644
+index e3719a5..3203470 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
-@@ -1272,6 +1272,7 @@ void d_walk(struct dentry *parent, void *data,
+@@ -1305,6 +1305,7 @@ void d_walk(struct dentry *parent, void *data,
seq = 1;
goto again;
}
struct check_mount {
struct vfsmount *mnt;
-@@ -2864,6 +2865,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
+@@ -2894,6 +2895,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
write_sequnlock(&rename_lock);
}
/**
* d_ancestor - search for an ancestor
diff --git a/fs/exec.c b/fs/exec.c
-index 65145a3..8d35776 100644
+index 62175cb..f0b6fdd 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -109,6 +109,7 @@ bool path_noexec(const struct path *path)
#ifdef CONFIG_USELIB
/*
diff --git a/fs/fcntl.c b/fs/fcntl.c
-index f5f4f94..c671660 100644
+index 659760e..5c37087 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
-@@ -83,6 +83,7 @@ int setfl(int fd, struct file * filp, unsigned long arg)
+@@ -84,6 +84,7 @@ int setfl(int fd, struct file * filp, unsigned long arg)
out:
return error;
}
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
int force)
diff --git a/fs/file_table.c b/fs/file_table.c
-index 954d510..4fb5b10 100644
+index 72e861a..01ae52f 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -148,6 +148,7 @@ struct file *get_empty_filp(void)
/**
* alloc_file - allocate and initialize a 'struct file'
-@@ -259,6 +260,7 @@ void flush_delayed_fput(void)
+@@ -260,6 +261,7 @@ void flush_delayed_fput(void)
{
delayed_fput(NULL);
}
static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput);
-@@ -301,6 +303,7 @@ void __fput_sync(struct file *file)
+@@ -302,6 +304,7 @@ void __fput_sync(struct file *file)
}
EXPORT_SYMBOL(fput);
void put_filp(struct file *file)
{
-@@ -309,6 +312,7 @@ void put_filp(struct file *file)
+@@ -310,6 +313,7 @@ void put_filp(struct file *file)
file_free(file);
}
}
void __init files_init(void)
{
diff --git a/fs/inode.c b/fs/inode.c
-index 9a9ba3a..a3a18d8 100644
+index 73820bf..7db829e 100644
--- a/fs/inode.c
+++ b/fs/inode.c
-@@ -1651,6 +1651,7 @@ int update_time(struct inode *inode, struct timespec *time, int flags)
+@@ -1650,6 +1650,7 @@ int update_time(struct inode *inode, struct timespec *time, int flags)
return update_time(inode, time, flags);
}
/**
* touch_atime - update the access time
diff --git a/fs/namespace.c b/fs/namespace.c
-index cc1375ef..9b4c67c 100644
+index f8893dc..c55d949 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
-@@ -465,6 +465,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
+@@ -463,6 +463,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
mnt_dec_writers(real_mount(mnt));
preempt_enable();
}
/**
* mnt_drop_write - give up write access to a mount
-@@ -1884,6 +1885,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
+@@ -1823,6 +1824,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
}
return 0;
}
static void cleanup_group_ids(struct mount *mnt, struct mount *end)
{
diff --git a/fs/notify/group.c b/fs/notify/group.c
-index fbe3cbe..bdfc61e 100644
+index 3235753..14a2d48 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -22,6 +22,7 @@
#include <linux/fsnotify_backend.h>
#include "fsnotify.h"
-@@ -100,6 +101,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
+@@ -109,6 +110,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
{
atomic_inc(&group->refcnt);
}
/*
* Drop a reference to a group. Free it if it's through.
-@@ -109,6 +111,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
+@@ -118,6 +120,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
if (atomic_dec_and_test(&group->refcnt))
fsnotify_final_destroy_group(group);
}
/*
* Create a new fsnotify_group and hold a reference for the group returned.
-@@ -137,6 +140,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
+@@ -147,6 +150,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
return group;
}
int fsnotify_fasync(int fd, struct file *file, int on)
{
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
-index 6043306..fdb50e4 100644
+index 9991f88..117042c 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
-@@ -113,6 +113,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
- mark->free_mark(mark);
- }
+@@ -118,6 +118,7 @@ static bool fsnotify_get_mark_safe(struct fsnotify_mark *mark)
+ {
+ return atomic_inc_not_zero(&mark->refcnt);
}
+EXPORT_SYMBOL_GPL(fsnotify_put_mark);
- /* Calculate mask of events for a list of marks */
- u32 fsnotify_recalc_mask(struct hlist_head *head)
-@@ -230,6 +231,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
+ static void __fsnotify_recalc_mask(struct fsnotify_mark_connector *conn)
+ {
+@@ -395,6 +396,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
mutex_unlock(&group->mark_mutex);
fsnotify_free_mark(mark);
}
+EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
- void fsnotify_destroy_marks(struct hlist_head *head, spinlock_t *lock)
- {
-@@ -415,6 +417,7 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark,
-
+ /*
+ * Sorting function for lists of fsnotify marks.
+@@ -607,6 +609,7 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark, struct inode *inode,
+ fsnotify_put_mark(mark);
return ret;
}
+EXPORT_SYMBOL_GPL(fsnotify_add_mark);
- int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group,
- struct inode *inode, struct vfsmount *mnt, int allow_dups)
-@@ -521,6 +524,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
- atomic_set(&mark->refcnt, 1);
- mark->free_mark = free_mark;
+ int fsnotify_add_mark(struct fsnotify_mark *mark, struct inode *inode,
+ struct vfsmount *mnt, int allow_dups)
+@@ -742,6 +745,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
+ fsnotify_get_group(group);
+ mark->group = group;
}
+EXPORT_SYMBOL_GPL(fsnotify_init_mark);
/*
* Destroy all marks in destroy_list, waits for SRCU period to finish before
diff --git a/fs/open.c b/fs/open.c
-index 949cef2..9a892fb8 100644
+index 35bb784..92e08c5 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
long vfs_truncate(const struct path *path, loff_t length)
{
-@@ -693,6 +694,7 @@ int open_check_o_direct(struct file *f)
+@@ -691,6 +692,7 @@ int open_check_o_direct(struct file *f)
}
return 0;
}
static int do_dentry_open(struct file *f,
struct inode *inode,
diff --git a/fs/read_write.c b/fs/read_write.c
-index eba4e7e..ec9e88a 100644
+index 6e542f0..c6fa090 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
-@@ -523,6 +523,7 @@ vfs_readf_t vfs_readf(struct file *file)
+@@ -483,6 +483,7 @@ vfs_readf_t vfs_readf(struct file *file)
return new_sync_read;
return ERR_PTR(-ENOSYS);
}
vfs_writef_t vfs_writef(struct file *file)
{
-@@ -534,6 +535,7 @@ vfs_writef_t vfs_writef(struct file *file)
+@@ -494,6 +495,7 @@ vfs_writef_t vfs_writef(struct file *file)
return new_sync_write;
return ERR_PTR(-ENOSYS);
}
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
{
diff --git a/fs/splice.c b/fs/splice.c
-index 46c87af..0efa652 100644
+index 9753304..b38e036 100644
--- a/fs/splice.c
+++ b/fs/splice.c
-@@ -872,6 +872,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -866,6 +866,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
return splice_write(pipe, out, ppos, len, flags);
}
/*
* Attempt to initiate a splice from a file to a pipe.
-@@ -901,6 +902,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
+@@ -895,6 +896,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
return splice_read(in, ppos, pipe, len, flags);
}
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff --git a/fs/sync.c b/fs/sync.c
-index abf6a5d..c86fe9c 100644
+index 7a5fa3f..c9b9d46 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -38,6 +38,7 @@ int __sync_filesystem(struct super_block *sb, int wait)
/*
* Write out and wait upon all dirty data associated with this
diff --git a/fs/xattr.c b/fs/xattr.c
-index 94f49a0..243f57e 100644
+index 464c94b..0234d49 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -296,6 +296,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
}
+EXPORT_SYMBOL_GPL(task_work_run);
diff --git a/security/commoncap.c b/security/commoncap.c
-index 78b3783..c8b3e88 100644
+index 7abebd7..c079ce4 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1062,12 +1062,14 @@ int cap_mmap_addr(unsigned long addr)
int devcgroup_inode_mknod(int mode, dev_t dev)
{
diff --git a/security/security.c b/security/security.c
-index d0e07f2..5e323b0 100644
+index 3013237..342ce8b 100644
--- a/security/security.c
+++ b/security/security.c
-@@ -481,6 +481,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
+@@ -535,6 +535,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
return 0;
return call_int_hook(path_rmdir, 0, dir, dentry);
}
int security_path_unlink(const struct path *dir, struct dentry *dentry)
{
-@@ -497,6 +498,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
+@@ -551,6 +552,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
return 0;
return call_int_hook(path_symlink, 0, dir, dentry, old_name);
}
int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
struct dentry *new_dentry)
-@@ -505,6 +507,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
+@@ -559,6 +561,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
return 0;
return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
}
int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
const struct path *new_dir, struct dentry *new_dentry,
-@@ -532,6 +535,7 @@ int security_path_truncate(const struct path *path)
+@@ -586,6 +589,7 @@ int security_path_truncate(const struct path *path)
return 0;
return call_int_hook(path_truncate, 0, path);
}
int security_path_chmod(const struct path *path, umode_t mode)
{
-@@ -539,6 +543,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
+@@ -593,6 +597,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
return 0;
return call_int_hook(path_chmod, 0, path, mode);
}
int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
{
-@@ -546,6 +551,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
+@@ -600,6 +605,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
return 0;
return call_int_hook(path_chown, 0, path, uid, gid);
}
int security_path_chroot(const struct path *path)
{
-@@ -631,6 +637,7 @@ int security_inode_readlink(struct dentry *dentry)
+@@ -685,6 +691,7 @@ int security_inode_readlink(struct dentry *dentry)
return 0;
return call_int_hook(inode_readlink, 0, dentry);
}
int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
bool rcu)
-@@ -646,6 +653,7 @@ int security_inode_permission(struct inode *inode, int mask)
+@@ -700,6 +707,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return call_int_hook(inode_permission, 0, inode, mask);
}
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
-@@ -817,6 +825,7 @@ int security_file_permission(struct file *file, int mask)
+@@ -871,6 +879,7 @@ int security_file_permission(struct file *file, int mask)
return fsnotify_perm(file, mask);
}
int security_file_alloc(struct file *file)
{
-@@ -876,6 +885,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
+@@ -930,6 +939,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
return ret;
return ima_file_mmap(file, prot);
}
+ will be empty. About XINO files, see the aufs manual.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt linux/Documentation/filesystems/aufs/design/01intro.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/01intro.txt 2017-07-29 12:14:25.893041746 +0200
++++ linux/Documentation/filesystems/aufs/design/01intro.txt 2017-09-05 10:42:11.038754821 +0200
@@ -0,0 +1,171 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
+Introduction
+----------------------------------------
+
-+aufs [ei ju: ef es] | [a u f s]
++aufs [ei ju: ef es] | /ey-yoo-ef-es/ | [a u f s]
+1. abbrev. for "advanced multi-layered unification filesystem".
+2. abbrev. for "another unionfs".
+3. abbrev. for "auf das" in German which means "on the" in English.
+-include ${srctree}/${src}/conf_priv.mk
diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
--- /usr/share/empty/fs/aufs/cpup.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.c 2017-07-29 12:14:25.899708630 +0200
++++ linux/fs/aufs/cpup.c 2017-09-05 10:42:11.055421928 +0200
@@ -0,0 +1,1442 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ if (!au_test_xfs(h_src_sb))
+ err = au_copy_file(dst, src, len);
+ else {
-+ inode_unlock(h_src_inode);
++ inode_unlock_shared(h_src_inode);
+ err = au_copy_file(dst, src, len);
-+ inode_lock(h_src_inode);
++ vfsub_inode_lock_shared_nested(h_src_inode, AuLsc_I_CHILD);
+ }
+
+ return err;
+ }
+
+ if (!au_test_nfs(h_src_sb)) {
-+ inode_unlock(h_src_inode);
++ inode_unlock_shared(h_src_inode);
+ err = vfsub_clone_file_range(src, dst, len);
-+ inode_lock(h_src_inode);
++ vfsub_inode_lock_shared_nested(h_src_inode, AuLsc_I_CHILD);
+ } else
+ err = vfsub_clone_file_range(src, dst, len);
+ /* older XFS has a condition in cloning */
+ cpg->len = l;
+ if (cpg->len) {
+ /* try stopping to update while we are referencing */
-+ inode_lock_nested(h_src_inode, AuLsc_I_CHILD);
++ vfsub_inode_lock_shared_nested(h_src_inode, AuLsc_I_CHILD);
+ au_pin_hdir_unlock(cpg->pin);
+
+ h_path.dentry = au_h_dptr(cpg->dentry, cpg->bsrc);
+ if (!au_test_nfs(h_src_inode->i_sb))
+ err = vfsub_getattr(&h_path, &h_src_attr->st);
+ else {
-+ inode_unlock(h_src_inode);
++ inode_unlock_shared(h_src_inode);
+ err = vfsub_getattr(&h_path, &h_src_attr->st);
-+ inode_lock_nested(h_src_inode, AuLsc_I_CHILD);
++ vfsub_inode_lock_shared_nested(h_src_inode, AuLsc_I_CHILD);
+ }
+ if (unlikely(err)) {
-+ inode_unlock(h_src_inode);
++ inode_unlock_shared(h_src_inode);
+ goto out;
+ }
+ h_src_attr->valid = 1;
+ if (!au_test_nfs(h_src_inode->i_sb)) {
+ err = au_cp_regular(cpg);
-+ inode_unlock(h_src_inode);
++ inode_unlock_shared(h_src_inode);
+ } else {
-+ inode_unlock(h_src_inode);
++ inode_unlock_shared(h_src_inode);
+ err = au_cp_regular(cpg);
+ }
+ rerr = au_pin_hdir_relock(cpg->pin);
+#endif /* __AUFS_DEBUG_H__ */
diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
--- /usr/share/empty/fs/aufs/dentry.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.c 2017-07-29 12:14:25.899708630 +0200
++++ linux/fs/aufs/dentry.c 2017-09-05 10:42:11.055421928 +0200
@@ -0,0 +1,1130 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ || (d_really_is_positive(dentry) && !d_is_dir(dentry)))
+ goto out; /* success */
+
-+ inode_lock_nested(h_inode, AuLsc_I_CHILD);
++ vfsub_inode_lock_shared_nested(h_inode, AuLsc_I_CHILD);
+ opq = au_diropq_test(h_dentry);
-+ inode_unlock(h_inode);
++ inode_unlock_shared(h_inode);
+ if (opq > 0)
+ au_set_dbdiropq(dentry, bindex);
+ else if (unlikely(opq < 0)) {
+ continue;
+
+ h_dir = d_inode(h_parent);
-+ inode_lock_nested(h_dir, AuLsc_I_PARENT);
++ vfsub_inode_lock_shared_nested(h_dir, AuLsc_I_PARENT);
+ h_dentry = au_do_lookup(h_parent, dentry, bindex, &whname,
+ &args);
-+ inode_unlock(h_dir);
++ inode_unlock_shared(h_dir);
+ err = PTR_ERR(h_dentry);
+ if (IS_ERR(h_dentry))
+ goto out_parent;
+}
diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
--- /usr/share/empty/fs/aufs/dir.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dir.c 2017-07-29 12:14:25.899708630 +0200
++++ linux/fs/aufs/dir.c 2017-09-05 10:42:11.058755349 +0200
@@ -0,0 +1,759 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ h_dentry = au_h_dptr(dentry, arg->bindex);
+ h_inode = d_inode(h_dentry);
+ /* todo: i_mode changes anytime? */
-+ inode_lock_nested(h_inode, AuLsc_I_CHILD);
++ vfsub_inode_lock_shared_nested(h_inode, AuLsc_I_CHILD);
+ err = au_test_h_perm_sio(h_inode, MAY_EXEC | MAY_READ);
-+ inode_unlock(h_inode);
++ inode_unlock_shared(h_inode);
+ if (!err)
+ err = do_test_empty(dentry, arg);
+ else {
+};
diff -urN /usr/share/empty/fs/aufs/file.h linux/fs/aufs/file.h
--- /usr/share/empty/fs/aufs/file.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/file.h 2017-07-29 12:14:25.903042072 +0200
-@@ -0,0 +1,330 @@
++++ linux/fs/aufs/file.h 2017-09-05 10:42:11.058755349 +0200
+@@ -0,0 +1,331 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ *
+
+#include <linux/file.h>
+#include <linux/fs.h>
++#include <linux/mm_types.h>
+#include <linux/poll.h>
+#include "rwsem.h"
+
+#endif /* __AUFS_FSTYPE_H__ */
diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
--- /usr/share/empty/fs/aufs/hfsnotify.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hfsnotify.c 2017-07-31 10:12:14.139177930 +0200
-@@ -0,0 +1,287 @@
++++ linux/fs/aufs/hfsnotify.c 2017-07-31 10:27:18.853311720 +0200
+@@ -0,0 +1,289 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ *
+ AuDebugOn(!br->br_hfsn);
+
+ mark = &hn->hn_mark;
-+ fsnotify_init_mark(mark, au_hfsn_free_mark);
++ fsnotify_init_mark(mark, br->br_hfsn->hfsn_group);
+ mark->mask = AuHfsnMask;
+ /*
+ * by udba rename or rmdir, aufs assign a new inode to the known
+ * h_inode, so specify 1 to allow dups.
+ */
+ lockdep_off();
-+ err = fsnotify_add_mark(mark, br->br_hfsn->hfsn_group, hinode->hi_inode,
-+ /*mnt*/NULL, /*allow_dups*/1);
++ err = fsnotify_add_mark(mark, hinode->hi_inode, /*mnt*/NULL,
++ /*allow_dups*/1);
+ lockdep_on();
+
+ return err;
+ struct fsnotify_mark *inode_mark,
+ struct fsnotify_mark *vfsmount_mark,
+ u32 mask, const void *data, int data_type,
-+ const unsigned char *file_name, u32 cookie)
++ const unsigned char *file_name, u32 cookie,
++ struct fsnotify_iter_info *iter_info)
+{
+ int err;
+ struct au_hnotify *hnotify;
+
+static struct fsnotify_ops au_hfsn_ops = {
+ .handle_event = au_hfsn_handle_event,
-+ .free_group_priv = au_hfsn_free_group
++ .free_group_priv = au_hfsn_free_group,
++ .free_mark = au_hfsn_free_mark
+};
+
+/* ---------------------------------------------------------------------- */
+}
diff -urN /usr/share/empty/fs/aufs/hnotify.c linux/fs/aufs/hnotify.c
--- /usr/share/empty/fs/aufs/hnotify.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hnotify.c 2017-07-29 12:14:25.903042072 +0200
++++ linux/fs/aufs/hnotify.c 2017-09-05 10:42:11.058755349 +0200
@@ -0,0 +1,711 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ if (au_ftest_hnjob(a->flags, TRYXINO0)
+ && a->inode
+ && a->h_inode) {
-+ inode_lock_nested(a->h_inode, AuLsc_I_CHILD);
++ vfsub_inode_lock_shared_nested(a->h_inode, AuLsc_I_CHILD);
+ if (!a->h_inode->i_nlink
+ && !(a->h_inode->i_state & I_LINKABLE))
+ hn_xino(a->inode, a->h_inode); /* ignore this error */
-+ inode_unlock(a->h_inode);
++ inode_unlock_shared(a->h_inode);
+ }
+
+ /* make the generation obsolete */
+}
diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
--- /usr/share/empty/fs/aufs/inode.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/inode.h 2017-07-29 12:14:25.903042072 +0200
-@@ -0,0 +1,686 @@
++++ linux/fs/aufs/inode.h 2017-09-05 10:42:11.058755349 +0200
+@@ -0,0 +1,694 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ *
+
+#include <linux/fsnotify.h>
+#include "rwsem.h"
++#include "vfsub.h"
+
+struct vfsmount;
+
+ au_hn_suspend(hdir);
+}
+
++static inline void au_hn_inode_lock_shared_nested(struct au_hinode *hdir,
++ unsigned int sc)
++{
++ vfsub_inode_lock_shared_nested(hdir->hi_inode, sc);
++ au_hn_suspend(hdir);
++}
++
+static inline void au_hn_inode_unlock(struct au_hinode *hdir)
+{
+ au_hn_resume(hdir);
+}
diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
--- /usr/share/empty/fs/aufs/i_op.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op.c 2017-07-29 12:14:25.903042072 +0200
++++ linux/fs/aufs/i_op.c 2017-09-05 10:42:11.058755349 +0200
@@ -0,0 +1,1452 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ if (!err && add_entry && !au_ftest_wrdir(add_entry, TMPFILE)) {
+ h_parent = au_h_dptr(parent, bcpup);
+ h_dir = d_inode(h_parent);
-+ inode_lock_nested(h_dir, AuLsc_I_PARENT);
++ vfsub_inode_lock_shared_nested(h_dir, AuLsc_I_PARENT);
+ err = au_lkup_neg(dentry, bcpup, /*wh*/0);
+ /* todo: no unlock here */
-+ inode_unlock(h_dir);
++ inode_unlock_shared(h_dir);
+
+ AuDbg("bcpup %d\n", bcpup);
+ if (!err) {
+ a->h_path.dentry = au_h_dptr(dentry, btop);
+ a->h_inode = d_inode(a->h_path.dentry);
+ if (ia && (ia->ia_valid & ATTR_SIZE)) {
-+ inode_lock_nested(a->h_inode, AuLsc_I_CHILD);
++ vfsub_inode_lock_shared_nested(a->h_inode, AuLsc_I_CHILD);
+ if (ia->ia_size < i_size_read(a->h_inode))
+ sz = ia->ia_size;
-+ inode_unlock(a->h_inode);
++ inode_unlock_shared(a->h_inode);
+ }
+
+ hi_wh = NULL;
+}
diff -urN /usr/share/empty/fs/aufs/opts.h linux/fs/aufs/opts.h
--- /usr/share/empty/fs/aufs/opts.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.h 2017-07-29 12:14:25.903042072 +0200
-@@ -0,0 +1,212 @@
++++ linux/fs/aufs/opts.h 2017-09-05 10:42:11.058755349 +0200
+@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ *
+const char *au_optstr_wbr_create(int wbr_create);
+
+void au_opts_free(struct au_opts *opts);
++struct super_block;
+int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts);
+int au_opts_verify(struct super_block *sb, unsigned long sb_flags,
+ unsigned int pending);
+#endif /* __AUFS_OPTS_H__ */
diff -urN /usr/share/empty/fs/aufs/plink.c linux/fs/aufs/plink.c
--- /usr/share/empty/fs/aufs/plink.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/plink.c 2017-07-29 12:14:25.903042072 +0200
++++ linux/fs/aufs/plink.c 2017-09-05 10:42:11.058755349 +0200
@@ -0,0 +1,514 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ struct inode *h_inode;
+
+ h_inode = d_inode(h_parent);
-+ inode_lock_nested(h_inode, AuLsc_I_CHILD2);
++ vfsub_inode_lock_shared_nested(h_inode, AuLsc_I_CHILD2);
+ h_dentry = vfsub_lkup_one(tgtname, h_parent);
-+ inode_unlock(h_inode);
++ inode_unlock_shared(h_inode);
+ return h_dentry;
+}
+
+}
diff -urN /usr/share/empty/fs/aufs/vfsub.h linux/fs/aufs/vfsub.h
--- /usr/share/empty/fs/aufs/vfsub.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vfsub.h 2017-07-29 12:14:25.906375514 +0200
-@@ -0,0 +1,353 @@
++++ linux/fs/aufs/vfsub.h 2017-09-05 10:42:11.058755349 +0200
+@@ -0,0 +1,360 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ *
+#define MtxMustLock(mtx) AuDebugOn(!mutex_is_locked(mtx))
+#define IMustLock(i) AuDebugOn(!inode_is_locked(i))
+
++/* why VFS doesn't define it? */
++static inline
++void vfsub_inode_lock_shared_nested(struct inode *inode, unsigned int sc)
++{
++ down_read_nested(&inode->i_rwsem, sc);
++}
++
+/* ---------------------------------------------------------------------- */
+
+static inline void vfsub_drop_nlink(struct inode *inode)
+}
diff -urN /usr/share/empty/fs/aufs/whout.h linux/fs/aufs/whout.h
--- /usr/share/empty/fs/aufs/whout.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/whout.h 2017-07-29 12:14:25.906375514 +0200
-@@ -0,0 +1,84 @@
++++ linux/fs/aufs/whout.h 2017-09-05 10:42:11.058755349 +0200
+@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ *
+int au_wh_name_alloc(struct qstr *wh, const struct qstr *name);
+int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio);
+int au_diropq_test(struct dentry *h_dentry);
++struct au_branch;
+struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br,
+ struct qstr *prefix);
+int au_whtmp_ren(struct dentry *h_dentry, struct au_branch *br);
+#endif /* __AUFS_WKQ_H__ */
diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
--- /usr/share/empty/fs/aufs/xattr.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/xattr.c 2017-07-29 12:14:25.906375514 +0200
++++ linux/fs/aufs/xattr.c 2017-09-05 10:42:11.058755349 +0200
@@ -0,0 +1,357 @@
+/*
+ * Copyright (C) 2014-2017 Junjiro R. Okajima
+ h_isrc = d_inode(h_src);
+ h_idst = d_inode(h_dst);
+ inode_unlock(h_idst);
-+ inode_lock_nested(h_isrc, AuLsc_I_CHILD);
++ vfsub_inode_lock_shared_nested(h_isrc, AuLsc_I_CHILD);
+ inode_lock_nested(h_idst, AuLsc_I_CHILD2);
+ unlocked = 0;
+
+ goto out;
+ err = vfs_listxattr(h_src, p, ssz);
+ }
-+ inode_unlock(h_isrc);
++ inode_unlock_shared(h_isrc);
+ unlocked = 1;
+ AuDbg("err %d, ssz %zd\n", err, ssz);
+ if (unlikely(err < 0))
+ kfree(o);
+out:
+ if (!unlocked)
-+ inode_unlock(h_isrc);
++ inode_unlock_shared(h_isrc);
+ AuTraceErr(err);
+ return err;
+}
+}
diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/linux/aufs_type.h
--- /usr/share/empty/include/uapi/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/include/uapi/linux/aufs_type.h 2017-07-31 10:12:14.139177930 +0200
++++ linux/include/uapi/linux/aufs_type.h 2017-09-05 10:42:11.058755349 +0200
@@ -0,0 +1,419 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+
+#include <linux/limits.h>
+
-+#define AUFS_VERSION "4.11.7+-20170703"
++#define AUFS_VERSION "4.x-rcN-20170904"
+
+/* todo? move this to linux-2.6.19/include/magic.h */
+#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
+#define AUFS_CTL_FHSM_FD _IOW(AuCtlType, AuCtl_FHSM_FD, int)
+
+#endif /* __AUFS_TYPE_H__ */
-aufs4.11.7+ loopback patch
+aufs4.x-rcN loopback patch
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index cf39138..29b33b2 100644
+index 10707c3..af32e47 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
-@@ -551,7 +551,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq)
+@@ -547,7 +547,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq)
}
struct switch_request {
struct completion wait;
};
-@@ -577,6 +577,7 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
+@@ -573,6 +573,7 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
mapping = file->f_mapping;
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
lo->lo_backing_file = file;
lo->lo_blocksize = S_ISBLK(mapping->host->i_mode) ?
mapping->host->i_bdev->bd_block_size : PAGE_SIZE;
lo->old_gfp_mask = mapping_gfp_mask(mapping);
-@@ -589,11 +590,13 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
+@@ -585,11 +586,13 @@ static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
* First it needs to flush existing IO, it does this by sending a magic
* BIO down the pipe. The completion of this BIO does the actual switch.
*/
/* freeze queue and wait for completion of scheduled requests */
blk_mq_freeze_queue(lo->lo_queue);
-@@ -612,7 +615,16 @@ static int loop_switch(struct loop_device *lo, struct file *file)
- */
- static int loop_flush(struct loop_device *lo)
- {
+@@ -611,7 +614,16 @@ static int loop_flush(struct loop_device *lo)
+ /* loop not yet configured, no running thread, nothing to flush */
+ if (lo->lo_state != Lo_bound)
+ return 0;
- return loop_switch(lo, NULL);
+ return loop_switch(lo, NULL, NULL);
+}
}
static void loop_reread_partitions(struct loop_device *lo,
-@@ -649,6 +661,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+@@ -648,6 +660,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
unsigned int arg)
{
struct file *file, *old_file;
struct inode *inode;
int error;
-@@ -665,9 +678,16 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+@@ -664,9 +677,16 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
file = fget(arg);
if (!file)
goto out;
error = -EINVAL;
-@@ -679,17 +699,21 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+@@ -678,17 +698,21 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
goto out_putf;
/* and ... switch */
out:
return error;
}
-@@ -876,7 +900,7 @@ static int loop_prepare_queue(struct loop_device *lo)
+@@ -882,7 +906,7 @@ static int loop_prepare_queue(struct loop_device *lo)
static int loop_set_fd(struct loop_device *lo, fmode_t mode,
struct block_device *bdev, unsigned int arg)
{
struct inode *inode;
struct address_space *mapping;
unsigned lo_blocksize;
-@@ -891,6 +915,12 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
+@@ -897,6 +921,12 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
file = fget(arg);
if (!file)
goto out;
error = -EBUSY;
if (lo->lo_state != Lo_unbound)
-@@ -943,6 +973,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
+@@ -949,6 +979,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
lo->lo_device = bdev;
lo->lo_flags = lo_flags;
lo->lo_backing_file = file;
lo->transfer = NULL;
lo->ioctl = NULL;
lo->lo_sizelimit = 0;
-@@ -975,6 +1006,8 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
+@@ -981,6 +1012,8 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
out_putf:
fput(file);
out:
/* This is safe: open() is still holding a reference. */
module_put(THIS_MODULE);
-@@ -1021,6 +1054,7 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer,
+@@ -1027,6 +1060,7 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer,
static int loop_clr_fd(struct loop_device *lo)
{
struct file *filp = lo->lo_backing_file;
gfp_t gfp = lo->old_gfp_mask;
struct block_device *bdev = lo->lo_device;
-@@ -1052,6 +1086,7 @@ static int loop_clr_fd(struct loop_device *lo)
+@@ -1058,6 +1092,7 @@ static int loop_clr_fd(struct loop_device *lo)
spin_lock_irq(&lo->lo_lock);
lo->lo_state = Lo_rundown;
lo->lo_backing_file = NULL;
spin_unlock_irq(&lo->lo_lock);
loop_release_xfer(lo);
-@@ -1096,6 +1131,8 @@ static int loop_clr_fd(struct loop_device *lo)
+@@ -1102,6 +1137,8 @@ static int loop_clr_fd(struct loop_device *lo)
* bd_mutex which is usually taken before lo_ctl_mutex.
*/
fput(filp);
}
diff --git a/drivers/block/loop.h b/drivers/block/loop.h
-index fb2237c..c3888c5 100644
+index fecd3f9..6b3a7c9 100644
--- a/drivers/block/loop.h
+++ b/drivers/block/loop.h
@@ -46,7 +46,7 @@ struct loop_device {
/* ---------------------------------------------------------------------- */
diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 433e314..b008398 100644
+index 9b21bb5..f7124fa 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -1810,6 +1810,10 @@ struct super_operations {
+@@ -1814,6 +1814,10 @@ struct super_operations {
struct shrink_control *);
long (*free_cached_objects)(struct super_block *,
struct shrink_control *);