Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 412702 Details for
Bug 560738
sys-fs/aufs4 USE="pax_kernel kernel-patch" Fails Patch
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch that applies cleanly over 4.1.7
aufs4-standalone-base-mmap-combined.patch (text/plain), 25.60 KB, created by
Sylvain Munaut
on 2015-09-24 08:50:21 UTC
(
hide
)
Description:
Patch that applies cleanly over 4.1.7
Filename:
MIME Type:
Creator:
Sylvain Munaut
Created:
2015-09-24 08:50:21 UTC
Size:
25.60 KB
patch
obsolete
>unchanged: >--- a/MAINTAINERS >+++ b/MAINTAINERS >@@ -1880,6 +1880,19 @@ F: include/linux/audit.h > F: include/uapi/linux/audit.h > F: kernel/audit* > >+AUFS (advanced multi layered unification filesystem) FILESYSTEM >+M: "J. R. Okajima" <hooanon05g@gmail.com> >+L: linux-unionfs@vger.kernel.org >+L: aufs-users@lists.sourceforge.net (members only) >+W: http://aufs.sourceforge.net >+T: git://github.com/sfjro/aufs4-linux.git >+S: Supported >+F: Documentation/filesystems/aufs/ >+F: Documentation/ABI/testing/debugfs-aufs >+F: Documentation/ABI/testing/sysfs-aufs >+F: fs/aufs/ >+F: include/uapi/linux/aufs_type.h >+ > AUXILIARY DISPLAY DRIVERS > M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> > W: http://miguelojeda.es/auxdisplay.htm >unchanged: >--- a/drivers/block/loop.c >+++ b/drivers/block/loop.c >@@ -540,6 +540,24 @@ static inline int is_loop_device(struct file *file) > return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR; > } > >+/* >+ * for AUFS >+ * no get/put for file. >+ */ >+struct file *loop_backing_file(struct super_block *sb) >+{ >+ struct file *ret; >+ struct loop_device *l; >+ >+ ret = NULL; >+ if (MAJOR(sb->s_dev) == LOOP_MAJOR) { >+ l = sb->s_bdev->bd_disk->private_data; >+ ret = l->lo_backing_file; >+ } >+ return ret; >+} >+EXPORT_SYMBOL(loop_backing_file); >+ > /* loop sysfs attributes */ > > static ssize_t loop_attr_show(struct device *dev, char *page, >unchanged: >--- b/fs/dcache.c >+++ b/fs/dcache.c >@@ -1164,7 +1164,7 @@ > * > * The @enter() and @finish() callbacks are called with d_lock held. > */ >-static void d_walk(struct dentry *parent, void *data, >+void d_walk(struct dentry *parent, void *data, > enum d_walk_ret (*enter)(void *, struct dentry *), > void (*finish)(void *)) > { >@@ -1269,6 +1269,7 @@ > seq = 1; > goto again; > } >+EXPORT_SYMBOL(d_walk); > > /* > * Search for at least 1 mount point in the dentry's subdirs. >unchanged: >--- b/fs/read_write.c >+++ b/fs/read_write.c >@@ -494,6 +494,30 @@ > } > EXPORT_SYMBOL(__vfs_write); > >+vfs_readf_t vfs_readf(struct file *file) >+{ >+ const struct file_operations *fop = file->f_op; >+ >+ if (fop->read) >+ return fop->read; >+ if (fop->read_iter) >+ return new_sync_read; >+ return ERR_PTR(-ENOSYS); >+} >+EXPORT_SYMBOL(vfs_readf); >+ >+vfs_writef_t vfs_writef(struct file *file) >+{ >+ const struct file_operations *fop = file->f_op; >+ >+ if (fop->write) >+ return fop->write; >+ if (fop->write_iter) >+ return new_sync_write; >+ return ERR_PTR(-ENOSYS); >+} >+EXPORT_SYMBOL(vfs_writef); >+ > ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) > { > mm_segment_t old_fs; >unchanged: >--- b/fs/splice.c >+++ b/fs/splice.c >@@ -1101,8 +1101,8 @@ > /* > * Attempt to initiate a splice from pipe to file. > */ >-static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, >- loff_t *ppos, size_t len, unsigned int flags) >+long do_splice_from(struct pipe_inode_info *pipe, struct file *out, >+ loff_t *ppos, size_t len, unsigned int flags) > { > ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, > loff_t *, size_t, unsigned int); >@@ -1114,13 +1114,14 @@ > > return splice_write(pipe, out, ppos, len, flags); > } >+EXPORT_SYMBOL(do_splice_from); > > /* > * Attempt to initiate a splice from a file to a pipe. > */ >-static long do_splice_to(struct file *in, loff_t *ppos, >- struct pipe_inode_info *pipe, size_t len, >- unsigned int flags) >+long do_splice_to(struct file *in, loff_t *ppos, >+ struct pipe_inode_info *pipe, size_t len, >+ unsigned int flags) > { > ssize_t (*splice_read)(struct file *, loff_t *, > struct pipe_inode_info *, size_t, unsigned int); >@@ -1140,6 +1141,7 @@ > > return splice_read(in, ppos, pipe, len, flags); > } >+EXPORT_SYMBOL(do_splice_to); > > /** > * splice_direct_to_actor - splices data directly between two non-pipes >unchanged: >--- a/include/linux/file.h >+++ b/include/linux/file.h >@@ -19,6 +19,7 @@ struct dentry; > struct path; > extern struct file *alloc_file(struct path *, fmode_t mode, > const struct file_operations *fop); >+extern struct file *get_empty_filp(void); > > static inline void fput_light(struct file *file, int fput_needed) > { >unchanged: >--- a/include/linux/fs.h >+++ b/include/linux/fs.h >@@ -1649,6 +1649,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, > struct iovec *fast_pointer, > struct iovec **ret_pointer); > >+typedef ssize_t (*vfs_readf_t)(struct file *, char __user *, size_t, loff_t *); >+typedef ssize_t (*vfs_writef_t)(struct file *, const char __user *, size_t, >+ loff_t *); >+vfs_readf_t vfs_readf(struct file *file); >+vfs_writef_t vfs_writef(struct file *file); >+ > 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 *); >unchanged: >--- a/include/linux/splice.h >+++ b/include/linux/splice.h >@@ -83,4 +83,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *); > extern void spd_release_page(struct splice_pipe_desc *, unsigned int); > > extern const struct pipe_buf_operations page_cache_pipe_buf_ops; >+ >+extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out, >+ loff_t *ppos, size_t len, unsigned int flags); >+extern long do_splice_to(struct file *in, loff_t *ppos, >+ struct pipe_inode_info *pipe, size_t len, >+ unsigned int flags); > #endif >unchanged: >--- a/fs/file_table.c >+++ b/fs/file_table.c >@@ -147,6 +147,7 @@ over: > } > return ERR_PTR(-ENFILE); > } >+EXPORT_SYMBOL(get_empty_filp); > > /** > * alloc_file - allocate and initialize a 'struct file' >@@ -308,6 +309,7 @@ void put_filp(struct file *file) > file_free(file); > } > } >+EXPORT_SYMBOL(put_filp); > > void __init files_init(unsigned long mempages) > { >unchanged: >--- a/fs/inode.c >+++ b/fs/inode.c >@@ -58,6 +58,7 @@ static struct hlist_head *inode_hashtable __read_mostly; > static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock); > > __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_sb_list_lock); >+EXPORT_SYMBOL(inode_sb_list_lock); > > /* > * Empty aops. Can be used for the cases where the user does not >unchanged: >--- a/fs/namespace.c >+++ b/fs/namespace.c >@@ -463,6 +463,7 @@ void __mnt_drop_write(struct vfsmount *mnt) > mnt_dec_writers(real_mount(mnt)); > preempt_enable(); > } >+EXPORT_SYMBOL_GPL(__mnt_drop_write); > > /** > * mnt_drop_write - give up write access to a mount >@@ -1768,6 +1769,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, > } > return 0; > } >+EXPORT_SYMBOL(iterate_mounts); > > static void cleanup_group_ids(struct mount *mnt, struct mount *end) > { >unchanged: >--- a/fs/notify/group.c >+++ b/fs/notify/group.c >@@ -22,6 +22,7 @@ > #include <linux/srcu.h> > #include <linux/rculist.h> > #include <linux/wait.h> >+#include <linux/module.h> > > #include <linux/fsnotify_backend.h> > #include "fsnotify.h" >@@ -72,6 +73,7 @@ void fsnotify_get_group(struct fsnotify_group *group) > { > atomic_inc(&group->refcnt); > } >+EXPORT_SYMBOL(fsnotify_get_group); > > /* > * Drop a reference to a group. Free it if it's through. >@@ -81,6 +83,7 @@ void fsnotify_put_group(struct fsnotify_group *group) > if (atomic_dec_and_test(&group->refcnt)) > fsnotify_final_destroy_group(group); > } >+EXPORT_SYMBOL(fsnotify_put_group); > > /* > * Create a new fsnotify_group and hold a reference for the group returned. >@@ -109,6 +112,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) > > return group; > } >+EXPORT_SYMBOL(fsnotify_alloc_group); > > int fsnotify_fasync(int fd, struct file *file, int on) > { >unchanged: >--- a/fs/notify/mark.c >+++ b/fs/notify/mark.c >@@ -109,6 +109,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark) > mark->free_mark(mark); > } > } >+EXPORT_SYMBOL(fsnotify_put_mark); > > /* Calculate mask of events for a list of marks */ > u32 fsnotify_recalc_mask(struct hlist_head *head) >@@ -202,6 +203,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark, > fsnotify_destroy_mark_locked(mark, group); > mutex_unlock(&group->mark_mutex); > } >+EXPORT_SYMBOL(fsnotify_destroy_mark); > > /* > * Destroy all marks in the given list. The marks must be already detached from >@@ -376,6 +378,7 @@ err: > > return ret; > } >+EXPORT_SYMBOL(fsnotify_add_mark); > > int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group, > struct inode *inode, struct vfsmount *mnt, int allow_dups) >@@ -455,6 +458,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark, > atomic_set(&mark->refcnt, 1); > mark->free_mark = free_mark; > } >+EXPORT_SYMBOL(fsnotify_init_mark); > > static int fsnotify_mark_destroy(void *ignored) > { >unchanged: >--- a/fs/open.c >+++ b/fs/open.c >@@ -62,6 +62,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, > mutex_unlock(&dentry->d_inode->i_mutex); > return ret; > } >+EXPORT_SYMBOL(do_truncate); > > long vfs_truncate(struct path *path, loff_t length) > { >@@ -676,6 +677,7 @@ int open_check_o_direct(struct file *f) > } > return 0; > } >+EXPORT_SYMBOL(open_check_o_direct); > > static int do_dentry_open(struct file *f, > int (*open)(struct inode *, struct file *), >unchanged: >--- a/fs/xattr.c >+++ b/fs/xattr.c >@@ -207,6 +207,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value, > *xattr_value = value; > return error; > } >+EXPORT_SYMBOL(vfs_getxattr_alloc); > > /* Compare an extended attribute value with the given value */ > int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, >unchanged: >--- a/security/commoncap.c >+++ b/security/commoncap.c >@@ -975,9 +975,11 @@ int cap_mmap_addr(unsigned long addr) > } > return ret; > } >+EXPORT_SYMBOL(cap_mmap_addr); > > int cap_mmap_file(struct file *file, unsigned long reqprot, > unsigned long prot, unsigned long flags) > { > return 0; > } >+EXPORT_SYMBOL(cap_mmap_file); >unchanged: >--- a/security/device_cgroup.c >+++ b/security/device_cgroup.c >@@ -7,6 +7,7 @@ > #include <linux/device_cgroup.h> > #include <linux/cgroup.h> > #include <linux/ctype.h> >+#include <linux/export.h> > #include <linux/list.h> > #include <linux/uaccess.h> > #include <linux/seq_file.h> >@@ -849,6 +850,7 @@ int __devcgroup_inode_permission(struct inode *inode, int mask) > return __devcgroup_check_permission(type, imajor(inode), iminor(inode), > access); > } >+EXPORT_SYMBOL(__devcgroup_inode_permission); > > int devcgroup_inode_mknod(int mode, dev_t dev) > { >unchanged: >--- a/security/security.c >+++ b/security/security.c >@@ -430,6 +430,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry) > return 0; > return security_ops->path_rmdir(dir, dentry); > } >+EXPORT_SYMBOL(security_path_rmdir); > > int security_path_unlink(struct path *dir, struct dentry *dentry) > { >@@ -446,6 +447,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry, > return 0; > return security_ops->path_symlink(dir, dentry, old_name); > } >+EXPORT_SYMBOL(security_path_symlink); > > int security_path_link(struct dentry *old_dentry, struct path *new_dir, > struct dentry *new_dentry) >@@ -454,6 +456,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, > return 0; > return security_ops->path_link(old_dentry, new_dir, new_dentry); > } >+EXPORT_SYMBOL(security_path_link); > > int security_path_rename(struct path *old_dir, struct dentry *old_dentry, > struct path *new_dir, struct dentry *new_dentry, >@@ -481,6 +484,7 @@ int security_path_truncate(struct path *path) > return 0; > return security_ops->path_truncate(path); > } >+EXPORT_SYMBOL(security_path_truncate); > > int security_path_chmod(struct path *path, umode_t mode) > { >@@ -488,6 +492,7 @@ int security_path_chmod(struct path *path, umode_t mode) > return 0; > return security_ops->path_chmod(path, mode); > } >+EXPORT_SYMBOL(security_path_chmod); > > int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) > { >@@ -495,6 +500,7 @@ int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) > return 0; > return security_ops->path_chown(path, uid, gid); > } >+EXPORT_SYMBOL(security_path_chown); > > int security_path_chroot(struct path *path) > { >@@ -580,6 +586,7 @@ int security_inode_readlink(struct dentry *dentry) > return 0; > return security_ops->inode_readlink(dentry); > } >+EXPORT_SYMBOL(security_inode_readlink); > > int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd) > { >@@ -594,6 +601,7 @@ int security_inode_permission(struct inode *inode, int mask) > return 0; > return security_ops->inode_permission(inode, mask); > } >+EXPORT_SYMBOL(security_inode_permission); > > int security_inode_setattr(struct dentry *dentry, struct iattr *attr) > { >@@ -716,6 +724,7 @@ int security_file_permission(struct file *file, int mask) > > return fsnotify_perm(file, mask); > } >+EXPORT_SYMBOL(security_file_permission); > > int security_file_alloc(struct file *file) > { >@@ -775,6 +784,7 @@ int security_mmap_file(struct file *file, unsigned long prot, > return ret; > return ima_file_mmap(file, prot); > } >+EXPORT_SYMBOL(security_mmap_file); > > int security_mmap_addr(unsigned long addr) > { >only in patch2: >unchanged: >--- a/fs/buffer.c >+++ b/fs/buffer.c >@@ -2450,7 +2450,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, > * Update file times before taking page lock. We may end up failing the > * fault so this update may be superfluous but who really cares... > */ >- file_update_time(vma->vm_file); >+ vma_file_update_time(vma); > > ret = __block_page_mkwrite(vma, vmf, get_block); > sb_end_pagefault(sb); >only in patch2: >unchanged: >--- a/fs/proc/base.c >+++ b/fs/proc/base.c >@@ -1744,7 +1744,7 @@ static int proc_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) { >- *path = vma->vm_file->f_path; >+ *path = vma_pr_or_file(vma)->f_path; > path_get(path); > rc = 0; > } >only in patch2: >unchanged: >--- a/fs/proc/nommu.c >+++ b/fs/proc/nommu.c >@@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region) > file = region->vm_file; > > if (file) { >- struct inode *inode = file_inode(region->vm_file); >+ struct inode *inode; >+ >+ file = vmr_pr_or_file(region); >+ inode = file_inode(file); > dev = inode->i_sb->s_dev; > ino = inode->i_ino; > } >only in patch2: >unchanged: >--- a/fs/proc/task_mmu.c >+++ b/fs/proc/task_mmu.c >@@ -279,7 +279,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) > const char *name = NULL; > > if (file) { >- struct inode *inode = file_inode(vma->vm_file); >+ struct inode *inode; >+ >+ file = vma_pr_or_file(vma); >+ inode = file_inode(file); > dev = inode->i_sb->s_dev; > ino = inode->i_ino; > pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; >@@ -1479,7 +1482,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; >- struct file *file = vma->vm_file; >+ struct file *file = vma_pr_or_file(vma); > struct mm_struct *mm = vma->vm_mm; > struct mm_walk walk = { > .hugetlb_entry = gather_hugetlb_stats, >only in patch2: >unchanged: >--- a/fs/proc/task_nommu.c >+++ b/fs/proc/task_nommu.c >@@ -160,7 +160,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma, > file = vma->vm_file; > > if (file) { >- struct inode *inode = file_inode(vma->vm_file); >+ struct inode *inode; >+ >+ file = vma_pr_or_file(vma); >+ inode = file_inode(file); > dev = inode->i_sb->s_dev; > ino = inode->i_ino; > pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; >only in patch2: >unchanged: >--- a/include/linux/mm.h >+++ b/include/linux/mm.h >@@ -1172,6 +1172,28 @@ static inline int fixup_user_fault(struct task_struct *tsk, > } > #endif > >+extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int); >+extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[], >+ int); >+extern void vma_do_get_file(struct vm_area_struct *, const char[], int); >+extern void vma_do_fput(struct vm_area_struct *, const char[], int); >+ >+#define vma_file_update_time(vma) vma_do_file_update_time(vma, __func__, \ >+ __LINE__) >+#define vma_pr_or_file(vma) vma_do_pr_or_file(vma, __func__, \ >+ __LINE__) >+#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__) >+#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__) >+ >+#ifndef CONFIG_MMU >+extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int); >+extern void vmr_do_fput(struct vm_region *, const char[], int); >+ >+#define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \ >+ __LINE__) >+#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__) >+#endif /* !CONFIG_MMU */ >+ > extern ssize_t access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, size_t len, int write); > extern ssize_t access_remote_vm(struct mm_struct *mm, unsigned long addr, > void *buf, size_t len, int write); >only in patch2: >unchanged: >--- a/include/linux/mm_types.h >+++ b/include/linux/mm_types.h >@@ -241,6 +241,7 @@ struct vm_region { > unsigned long vm_top; /* region allocated to here */ > unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ > struct file *vm_file; /* the backing file or NULL */ >+ struct file *vm_prfile; /* the virtual backing file or NULL */ > > int vm_usage; /* region usage count (access under nommu_region_sem) */ > bool vm_icache_flushed : 1; /* true if the icache has been flushed for >@@ -305,6 +306,7 @@ struct vm_area_struct { > unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE > units, *not* PAGE_CACHE_SIZE */ > struct file * vm_file; /* File we map to (can be NULL). */ >+ struct file *vm_prfile; /* shadow of vm_file */ > void * vm_private_data; /* was vm_pte (shared mem) */ > > #ifndef CONFIG_MMU >only in patch2: >unchanged: >--- a/kernel/fork.c >+++ b/kernel/fork.c >@@ -456,7 +456,7 @@ static struct vm_area_struct *dup_vma(struct mm_struct *mm, struct mm_struct *oldmm, struct vm_area_struct *mpnt) > struct inode *inode = file_inode(file); > struct address_space *mapping = file->f_mapping; > >- get_file(file); >+ vma_get_file(tmp); > if (tmp->vm_flags & VM_DENYWRITE) > atomic_dec(&inode->i_writecount); > i_mmap_lock_write(mapping); >only in patch2: >unchanged: >--- a/mm/Makefile >+++ b/mm/Makefile >@@ -21,7 +21,7 @@ obj-y := filemap.o mempool.o oom_kill.o \ > mm_init.o mmu_context.o percpu.o slab_common.o \ > compaction.o vmacache.o \ > interval_tree.o list_lru.o workingset.o \ >- debug.o $(mmu-y) >+ prfile.o debug.o $(mmu-y) > > obj-y += init-mm.o > >only in patch2: >unchanged: >--- a/mm/filemap.c >+++ b/mm/filemap.c >@@ -2062,7 +2062,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) > int ret = VM_FAULT_LOCKED; > > sb_start_pagefault(inode->i_sb); >- file_update_time(vma->vm_file); >+ vma_file_update_time(vma); > lock_page(page); > if (page->mapping != inode->i_mapping) { > unlock_page(page); >only in patch2: >unchanged: >--- a/mm/madvise.c >+++ b/mm/madvise.c >@@ -320,12 +320,12 @@ static long madvise_remove(struct vm_area_struct *vma, > * vma's reference to the file) can go away as soon as we drop > * mmap_sem. > */ >- get_file(f); >+ vma_get_file(vma); > up_read(¤t->mm->mmap_sem); > error = vfs_fallocate(f, > FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, > offset, end - start); >- fput(f); >+ vma_fput(vma); > down_read(¤t->mm->mmap_sem); > return error; > } >only in patch2: >unchanged: >--- a/mm/memory.c >+++ b/mm/memory.c >@@ -2034,7 +2034,7 @@ static inline int wp_page_reuse(struct mm_struct *mm, > } > > if (!page_mkwrite) >- file_update_time(vma->vm_file); >+ vma_file_update_time(vma); > } > > return VM_FAULT_WRITE; >only in patch2: >unchanged: >--- a/mm/mmap.c >+++ b/mm/mmap.c >@@ -274,7 +274,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) > if (vma->vm_ops && vma->vm_ops->close) > vma->vm_ops->close(vma); > if (vma->vm_file) >- fput(vma->vm_file); >+ vma_fput(vma); > mpol_put(vma_policy(vma)); > kmem_cache_free(vm_area_cachep, vma); > return next; >@@ -886,7 +886,7 @@ again: remove_next = 1 + (end > next->vm_end); > if (remove_next) { > if (file) { > uprobe_munmap(next, next->vm_start, next->vm_end); >- fput(file); >+ vma_fput(vma); > } > if (next->anon_vma) > anon_vma_merge(vma, next); >@@ -1671,8 +1671,8 @@ out: > return addr; > > unmap_and_free_vma: >+ vma_fput(vma); > vma->vm_file = NULL; >- fput(file); > > /* Undo any partial mapping done by a device driver. */ > unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); >@@ -2473,7 +2473,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, > goto out_free_mpol; > > if (new->vm_file) >- get_file(new->vm_file); >+ vma_get_file(new); > > if (new->vm_ops && new->vm_ops->open) > new->vm_ops->open(new); >@@ -2492,7 +2492,7 @@ static 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) >- fput(new->vm_file); >+ vma_fput(new); > out_free_mpol: > mpol_put(vma_policy(new)); > out_free_vma: >@@ -2635,7 +2635,6 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, > struct vm_area_struct *vma; > unsigned long populate = 0; > unsigned long ret = -EINVAL; >- struct file *file; > > pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. " > "See Documentation/vm/remap_file_pages.txt.\n", >@@ -2679,10 +2678,10 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, > munlock_vma_pages_range(vma, start, start + size); > } > >- file = get_file(vma->vm_file); >+ vma_get_file(vma); > ret = do_mmap_pgoff(vma->vm_file, start, size, > prot, flags, pgoff, &populate); >- fput(file); >+ vma_fput(vma); > out: > up_write(&mm->mmap_sem); > if (populate) >@@ -2949,7 +2948,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) >- get_file(new_vma->vm_file); >+ vma_get_file(new_vma); > if (new_vma->vm_ops && new_vma->vm_ops->open) > new_vma->vm_ops->open(new_vma); > vma_link(mm, new_vma, prev, rb_link, rb_parent); >only in patch2: >unchanged: >--- a/mm/msync.c >+++ b/mm/msync.c >@@ -84,10 +84,10 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) > start = vma->vm_end; > if ((flags & MS_SYNC) && file && > (vma->vm_flags & VM_SHARED)) { >- get_file(file); >+ vma_get_file(vma); > up_read(&mm->mmap_sem); > error = vfs_fsync_range(file, fstart, fend, 1); >- fput(file); >+ vma_fput(vma); > if (error || start >= end) > goto out; > down_read(&mm->mmap_sem); >only in patch2: >unchanged: >--- a/mm/nommu.c >+++ b/mm/nommu.c >@@ -693,7 +693,7 @@ static void __put_nommu_region(struct vm_region *region) > up_write(&nommu_region_sem); > > if (region->vm_file) >- fput(region->vm_file); >+ vmr_fput(region); > > /* IO memory and memory shared directly out of the pagecache > * from ramfs/tmpfs mustn't be released here */ >@@ -858,7 +858,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) >- fput(vma->vm_file); >+ vma_fput(vma); > put_nommu_region(vma->vm_region); > kmem_cache_free(vm_area_cachep, vma); > } >@@ -1398,7 +1398,7 @@ unsigned long do_mmap_pgoff(struct file *file, > goto error_just_free; > } > } >- fput(region->vm_file); >+ vmr_fput(region); > kmem_cache_free(vm_region_jar, region); > region = pregion; > result = start; >@@ -1474,10 +1474,10 @@ error_just_free: > up_write(&nommu_region_sem); > error: > if (region->vm_file) >- fput(region->vm_file); >+ vmr_fput(region); > kmem_cache_free(vm_region_jar, region); > if (vma->vm_file) >- fput(vma->vm_file); >+ vma_fput(vma); > kmem_cache_free(vm_area_cachep, vma); > kleave(" = %d", ret); > return ret; >only in patch2: >unchanged: >--- /dev/null >+++ b/mm/prfile.c >@@ -0,0 +1,86 @@ >+/* >+ * Mainly for aufs which mmap(2) diffrent file and wants to print different path >+ * in /proc/PID/maps. >+ * Call these functions via macros defined in linux/mm.h. >+ * >+ * See Documentation/filesystems/aufs/design/06mmap.txt >+ * >+ * Copyright (c) 2014 Junjro R. Okajima >+ * Copyright (c) 2014 Ian Campbell >+ */ >+ >+#include <linux/mm.h> >+#include <linux/file.h> >+#include <linux/fs.h> >+ >+/* #define PRFILE_TRACE */ >+static inline void prfile_trace(struct file *f, struct file *pr, >+ const char func[], int line, const char func2[]) >+{ >+#ifdef PRFILE_TRACE >+ if (pr) >+ pr_info("%s:%d: %s, %p\n", func, line, func2, >+ f ? (char *)f->f_path.dentry->d_name.name : "(null)"); >+#endif >+} >+ >+void vma_do_file_update_time(struct vm_area_struct *vma, const char func[], >+ int line) >+{ >+ struct file *f = vma->vm_file, *pr = vma->vm_prfile; >+ >+ prfile_trace(f, pr, func, line, __func__); >+ file_update_time(f); >+ if (f && pr) >+ file_update_time(pr); >+} >+ >+struct file *vma_do_pr_or_file(struct vm_area_struct *vma, const char func[], >+ int line) >+{ >+ struct file *f = vma->vm_file, *pr = vma->vm_prfile; >+ >+ prfile_trace(f, pr, func, line, __func__); >+ return (f && pr) ? pr : f; >+} >+ >+void vma_do_get_file(struct vm_area_struct *vma, const char func[], int line) >+{ >+ struct file *f = vma->vm_file, *pr = vma->vm_prfile; >+ >+ prfile_trace(f, pr, func, line, __func__); >+ get_file(f); >+ if (f && pr) >+ get_file(pr); >+} >+ >+void vma_do_fput(struct vm_area_struct *vma, const char func[], int line) >+{ >+ struct file *f = vma->vm_file, *pr = vma->vm_prfile; >+ >+ prfile_trace(f, pr, func, line, __func__); >+ fput(f); >+ if (f && pr) >+ fput(pr); >+} >+ >+#ifndef CONFIG_MMU >+struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[], >+ int line) >+{ >+ struct file *f = region->vm_file, *pr = region->vm_prfile; >+ >+ prfile_trace(f, pr, func, line, __func__); >+ return (f && pr) ? pr : f; >+} >+ >+void vmr_do_fput(struct vm_region *region, const char func[], int line) >+{ >+ struct file *f = region->vm_file, *pr = region->vm_prfile; >+ >+ prfile_trace(f, pr, func, line, __func__); >+ fput(f); >+ if (f && pr) >+ fput(pr); >+} >+#endif /* !CONFIG_MMU */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 560738
:
412160
| 412702