From d94181d688c220f6574587081a3cf84fb1b3fc42 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 23 Jun 2015 14:49:21 -0500 Subject: update patch to compile with noMMU --- target/linux/patches/4.0.5/aufs4.patch | 4022 +++++++++++++++----------------- 1 file changed, 1825 insertions(+), 2197 deletions(-) (limited to 'target/linux') diff --git a/target/linux/patches/4.0.5/aufs4.patch b/target/linux/patches/4.0.5/aufs4.patch index 73b035010..db38c850a 100644 --- a/target/linux/patches/4.0.5/aufs4.patch +++ b/target/linux/patches/4.0.5/aufs4.patch @@ -1,1553 +1,6 @@ -diff -Nur linux-4.0.4.orig/Documentation/ABI/testing/debugfs-aufs linux-4.0.4/Documentation/ABI/testing/debugfs-aufs ---- linux-4.0.4.orig/Documentation/ABI/testing/debugfs-aufs 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/ABI/testing/debugfs-aufs 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,50 @@ -+What: /debug/aufs/si_/ -+Date: March 2009 -+Contact: J. R. Okajima -+Description: -+ Under /debug/aufs, a directory named si_ is created -+ per aufs mount, where is a unique id generated -+ internally. -+ -+What: /debug/aufs/si_/plink -+Date: Apr 2013 -+Contact: J. R. Okajima -+Description: -+ It has three lines and shows the information about the -+ pseudo-link. The first line is a single number -+ representing a number of buckets. The second line is a -+ number of pseudo-links per buckets (separated by a -+ blank). The last line is a single number representing a -+ total number of psedo-links. -+ When the aufs mount option 'noplink' is specified, it -+ will show "1\n0\n0\n". -+ -+What: /debug/aufs/si_/xib -+Date: March 2009 -+Contact: J. R. Okajima -+Description: -+ It shows the consumed blocks by xib (External Inode Number -+ Bitmap), its block size and file size. -+ When the aufs mount option 'noxino' is specified, it -+ will be empty. About XINO files, see the aufs manual. -+ -+What: /debug/aufs/si_/xino0, xino1 ... xinoN -+Date: March 2009 -+Contact: J. R. Okajima -+Description: -+ It shows the consumed blocks by xino (External Inode Number -+ Translation Table), its link count, block size and file -+ size. -+ When the aufs mount option 'noxino' is specified, it -+ will be empty. About XINO files, see the aufs manual. -+ -+What: /debug/aufs/si_/xigen -+Date: March 2009 -+Contact: J. R. Okajima -+Description: -+ It shows the consumed blocks by xigen (External Inode -+ Generation Table), its block size and file size. -+ If CONFIG_AUFS_EXPORT is disabled, this entry will not -+ be created. -+ When the aufs mount option 'noxino' is specified, it -+ will be empty. About XINO files, see the aufs manual. -diff -Nur linux-4.0.4.orig/Documentation/ABI/testing/sysfs-aufs linux-4.0.4/Documentation/ABI/testing/sysfs-aufs ---- linux-4.0.4.orig/Documentation/ABI/testing/sysfs-aufs 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/ABI/testing/sysfs-aufs 2015-05-30 22:11:29.000000000 +0200 -@@ -0,0 +1,31 @@ -+What: /sys/fs/aufs/si_/ -+Date: March 2009 -+Contact: J. R. Okajima -+Description: -+ Under /sys/fs/aufs, a directory named si_ is created -+ per aufs mount, where is a unique id generated -+ internally. -+ -+What: /sys/fs/aufs/si_/br0, br1 ... brN -+Date: March 2009 -+Contact: J. R. Okajima -+Description: -+ It shows the abolute path of a member directory (which -+ is called branch) in aufs, and its permission. -+ -+What: /sys/fs/aufs/si_/brid0, brid1 ... bridN -+Date: July 2013 -+Contact: J. R. Okajima -+Description: -+ It shows the id of a member directory (which is called -+ branch) in aufs. -+ -+What: /sys/fs/aufs/si_/xi_path -+Date: March 2009 -+Contact: J. R. Okajima -+Description: -+ It shows the abolute path of XINO (External Inode Number -+ Bitmap, Translation Table and Generation Table) file -+ even if it is the default path. -+ When the aufs mount option 'noxino' is specified, it -+ will be empty. About XINO files, see the aufs manual. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/01intro.txt linux-4.0.4/Documentation/filesystems/aufs/design/01intro.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/01intro.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/01intro.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,157 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+Introduction -+---------------------------------------- -+ -+aufs [ei ju: 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. -+ Ex. "Butter aufs Brot"(G) means "butter onto bread"(E). -+ But "Filesystem aufs Filesystem" is hard to understand. -+ -+AUFS is a filesystem with features: -+- multi layered stackable unification filesystem, the member directory -+ is called as a branch. -+- branch permission and attribute, 'readonly', 'real-readonly', -+ 'readwrite', 'whiteout-able', 'link-able whiteout', etc. and their -+ combination. -+- internal "file copy-on-write". -+- logical deletion, whiteout. -+- dynamic branch manipulation, adding, deleting and changing permission. -+- allow bypassing aufs, user's direct branch access. -+- external inode number translation table and bitmap which maintains the -+ persistent aufs inode number. -+- seekable directory, including NFS readdir. -+- file mapping, mmap and sharing pages. -+- pseudo-link, hardlink over branches. -+- loopback mounted filesystem as a branch. -+- several policies to select one among multiple writable branches. -+- revert a single systemcall when an error occurs in aufs. -+- and more... -+ -+ -+Multi Layered Stackable Unification Filesystem -+---------------------------------------------------------------------- -+Most people already knows what it is. -+It is a filesystem which unifies several directories and provides a -+merged single directory. When users access a file, the access will be -+passed/re-directed/converted (sorry, I am not sure which English word is -+correct) to the real file on the member filesystem. The member -+filesystem is called 'lower filesystem' or 'branch' and has a mode -+'readonly' and 'readwrite.' And the deletion for a file on the lower -+readonly branch is handled by creating 'whiteout' on the upper writable -+branch. -+ -+On LKML, there have been discussions about UnionMount (Jan Blunck, -+Bharata B Rao and Valerie Aurora) and Unionfs (Erez Zadok). They took -+different approaches to implement the merged-view. -+The former tries putting it into VFS, and the latter implements as a -+separate filesystem. -+(If I misunderstand about these implementations, please let me know and -+I shall correct it. Because it is a long time ago when I read their -+source files last time). -+ -+UnionMount's approach will be able to small, but may be hard to share -+branches between several UnionMount since the whiteout in it is -+implemented in the inode on branch filesystem and always -+shared. According to Bharata's post, readdir does not seems to be -+finished yet. -+There are several missing features known in this implementations such as -+- for users, the inode number may change silently. eg. copy-up. -+- link(2) may break by copy-up. -+- read(2) may get an obsoleted filedata (fstat(2) too). -+- fcntl(F_SETLK) may be broken by copy-up. -+- unnecessary copy-up may happen, for example mmap(MAP_PRIVATE) after -+ open(O_RDWR). -+ -+In linux-3.18, "overlay" filesystem (formerly known as "overlayfs") was -+merged into mainline. This is another implementation of UnionMount as a -+separated filesystem. All the limitations and known problems which -+UnionMount are equally inherited to "overlay" filesystem. -+ -+Unionfs has a longer history. When I started implementing a stackable -+filesystem (Aug 2005), it already existed. It has virtual super_block, -+inode, dentry and file objects and they have an array pointing lower -+same kind objects. After contributing many patches for Unionfs, I -+re-started my project AUFS (Jun 2006). -+ -+In AUFS, the structure of filesystem resembles to Unionfs, but I -+implemented my own ideas, approaches and enhancements and it became -+totally different one. -+ -+Comparing DM snapshot and fs based implementation -+- the number of bytes to be copied between devices is much smaller. -+- the type of filesystem must be one and only. -+- the fs must be writable, no readonly fs, even for the lower original -+ device. so the compression fs will not be usable. but if we use -+ loopback mount, we may address this issue. -+ for instance, -+ mount /cdrom/squashfs.img /sq -+ losetup /sq/ext2.img -+ losetup /somewhere/cow -+ dmsetup "snapshot /dev/loop0 /dev/loop1 ..." -+- it will be difficult (or needs more operations) to extract the -+ difference between the original device and COW. -+- DM snapshot-merge may help a lot when users try merging. in the -+ fs-layer union, users will use rsync(1). -+ -+You may want to read my old paper "Filesystems in LiveCD" -+(http://aufs.sourceforge.net/aufs2/report/sq/sq.pdf). -+ -+ -+Several characters/aspects/persona of aufs -+---------------------------------------------------------------------- -+ -+Aufs has several characters, aspects or persona. -+1. a filesystem, callee of VFS helper -+2. sub-VFS, caller of VFS helper for branches -+3. a virtual filesystem which maintains persistent inode number -+4. reader/writer of files on branches such like an application -+ -+1. Callee of VFS Helper -+As an ordinary linux filesystem, aufs is a callee of VFS. For instance, -+unlink(2) from an application reaches sys_unlink() kernel function and -+then vfs_unlink() is called. vfs_unlink() is one of VFS helper and it -+calls filesystem specific unlink operation. Actually aufs implements the -+unlink operation but it behaves like a redirector. -+ -+2. Caller of VFS Helper for Branches -+aufs_unlink() passes the unlink request to the branch filesystem as if -+it were called from VFS. So the called unlink operation of the branch -+filesystem acts as usual. As a caller of VFS helper, aufs should handle -+every necessary pre/post operation for the branch filesystem. -+- acquire the lock for the parent dir on a branch -+- lookup in a branch -+- revalidate dentry on a branch -+- mnt_want_write() for a branch -+- vfs_unlink() for a branch -+- mnt_drop_write() for a branch -+- release the lock on a branch -+ -+3. Persistent Inode Number -+One of the most important issue for a filesystem is to maintain inode -+numbers. This is particularly important to support exporting a -+filesystem via NFS. Aufs is a virtual filesystem which doesn't have a -+backend block device for its own. But some storage is necessary to -+keep and maintain the inode numbers. It may be a large space and may not -+suit to keep in memory. Aufs rents some space from its first writable -+branch filesystem (by default) and creates file(s) on it. These files -+are created by aufs internally and removed soon (currently) keeping -+opened. -+Note: Because these files are removed, they are totally gone after -+ unmounting aufs. It means the inode numbers are not persistent -+ across unmount or reboot. I have a plan to make them really -+ persistent which will be important for aufs on NFS server. -+ -+4. Read/Write Files Internally (copy-on-write) -+Because a branch can be readonly, when you write a file on it, aufs will -+"copy-up" it to the upper writable branch internally. And then write the -+originally requested thing to the file. Generally kernel doesn't -+open/read/write file actively. In aufs, even a single write may cause a -+internal "file copy". This behaviour is very similar to cp(1) command. -+ -+Some people may think it is better to pass such work to user space -+helper, instead of doing in kernel space. Actually I am still thinking -+about it. But currently I have implemented it in kernel space. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/02struct.txt linux-4.0.4/Documentation/filesystems/aufs/design/02struct.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/02struct.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/02struct.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,245 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+Basic Aufs Internal Structure -+ -+Superblock/Inode/Dentry/File Objects -+---------------------------------------------------------------------- -+As like an ordinary filesystem, aufs has its own -+superblock/inode/dentry/file objects. All these objects have a -+dynamically allocated array and store the same kind of pointers to the -+lower filesystem, branch. -+For example, when you build a union with one readwrite branch and one -+readonly, mounted /au, /rw and /ro respectively. -+- /au = /rw + /ro -+- /ro/fileA exists but /rw/fileA -+ -+Aufs lookup operation finds /ro/fileA and gets dentry for that. These -+pointers are stored in a aufs dentry. The array in aufs dentry will be, -+- [0] = NULL (because /rw/fileA doesn't exist) -+- [1] = /ro/fileA -+ -+This style of an array is essentially same to the aufs -+superblock/inode/dentry/file objects. -+ -+Because aufs supports manipulating branches, ie. add/delete/change -+branches dynamically, these objects has its own generation. When -+branches are changed, the generation in aufs superblock is -+incremented. And a generation in other object are compared when it is -+accessed. When a generation in other objects are obsoleted, aufs -+refreshes the internal array. -+ -+ -+Superblock -+---------------------------------------------------------------------- -+Additionally aufs superblock has some data for policies to select one -+among multiple writable branches, XIB files, pseudo-links and kobject. -+See below in detail. -+About the policies which supports copy-down a directory, see -+wbr_policy.txt too. -+ -+ -+Branch and XINO(External Inode Number Translation Table) -+---------------------------------------------------------------------- -+Every branch has its own xino (external inode number translation table) -+file. The xino file is created and unlinked by aufs internally. When two -+members of a union exist on the same filesystem, they share the single -+xino file. -+The struct of a xino file is simple, just a sequence of aufs inode -+numbers which is indexed by the lower inode number. -+In the above sample, assume the inode number of /ro/fileA is i111 and -+aufs assigns the inode number i999 for fileA. Then aufs writes 999 as -+4(8) bytes at 111 * 4(8) bytes offset in the xino file. -+ -+When the inode numbers are not contiguous, the xino file will be sparse -+which has a hole in it and doesn't consume as much disk space as it -+might appear. If your branch filesystem consumes disk space for such -+holes, then you should specify 'xino=' option at mounting aufs. -+ -+Aufs has a mount option to free the disk blocks for such holes in XINO -+files on tmpfs or ramdisk. But it is not so effective actually. If you -+meet a problem of disk shortage due to XINO files, then you should try -+"tmpfs-ino.patch" (and "vfs-ino.patch" too) in aufs4-standalone.git. -+The patch localizes the assignment inumbers per tmpfs-mount and avoid -+the holes in XINO files. -+ -+Also a writable branch has three kinds of "whiteout bases". All these -+are existed when the branch is joined to aufs, and their names are -+whiteout-ed doubly, so that users will never see their names in aufs -+hierarchy. -+1. a regular file which will be hardlinked to all whiteouts. -+2. a directory to store a pseudo-link. -+3. a directory to store an "orphan"-ed file temporary. -+ -+1. Whiteout Base -+ When you remove a file on a readonly branch, aufs handles it as a -+ logical deletion and creates a whiteout on the upper writable branch -+ as a hardlink of this file in order not to consume inode on the -+ writable branch. -+2. Pseudo-link Dir -+ See below, Pseudo-link. -+3. Step-Parent Dir -+ When "fileC" exists on the lower readonly branch only and it is -+ opened and removed with its parent dir, and then user writes -+ something into it, then aufs copies-up fileC to this -+ directory. Because there is no other dir to store fileC. After -+ creating a file under this dir, the file is unlinked. -+ -+Because aufs supports manipulating branches, ie. add/delete/change -+dynamically, a branch has its own id. When the branch order changes, -+aufs finds the new index by searching the branch id. -+ -+ -+Pseudo-link -+---------------------------------------------------------------------- -+Assume "fileA" exists on the lower readonly branch only and it is -+hardlinked to "fileB" on the branch. When you write something to fileA, -+aufs copies-up it to the upper writable branch. Additionally aufs -+creates a hardlink under the Pseudo-link Directory of the writable -+branch. The inode of a pseudo-link is kept in aufs super_block as a -+simple list. If fileB is read after unlinking fileA, aufs returns -+filedata from the pseudo-link instead of the lower readonly -+branch. Because the pseudo-link is based upon the inode, to keep the -+inode number by xino (see above) is essentially necessary. -+ -+All the hardlinks under the Pseudo-link Directory of the writable branch -+should be restored in a proper location later. Aufs provides a utility -+to do this. The userspace helpers executed at remounting and unmounting -+aufs by default. -+During this utility is running, it puts aufs into the pseudo-link -+maintenance mode. In this mode, only the process which began the -+maintenance mode (and its child processes) is allowed to operate in -+aufs. Some other processes which are not related to the pseudo-link will -+be allowed to run too, but the rest have to return an error or wait -+until the maintenance mode ends. If a process already acquires an inode -+mutex (in VFS), it has to return an error. -+ -+ -+XIB(external inode number bitmap) -+---------------------------------------------------------------------- -+Addition to the xino file per a branch, aufs has an external inode number -+bitmap in a superblock object. It is also an internal file such like a -+xino file. -+It is a simple bitmap to mark whether the aufs inode number is in-use or -+not. -+To reduce the file I/O, aufs prepares a single memory page to cache xib. -+ -+As well as XINO files, aufs has a feature to truncate/refresh XIB to -+reduce the number of consumed disk blocks for these files. -+ -+ -+Virtual or Vertical Dir, and Readdir in Userspace -+---------------------------------------------------------------------- -+In order to support multiple layers (branches), aufs readdir operation -+constructs a virtual dir block on memory. For readdir, aufs calls -+vfs_readdir() internally for each dir on branches, merges their entries -+with eliminating the whiteout-ed ones, and sets it to file (dir) -+object. So the file object has its entry list until it is closed. The -+entry list will be updated when the file position is zero and becomes -+obsoleted. This decision is made in aufs automatically. -+ -+The dynamically allocated memory block for the name of entries has a -+unit of 512 bytes (by default) and stores the names contiguously (no -+padding). Another block for each entry is handled by kmem_cache too. -+During building dir blocks, aufs creates hash list and judging whether -+the entry is whiteouted by its upper branch or already listed. -+The merged result is cached in the corresponding inode object and -+maintained by a customizable life-time option. -+ -+Some people may call it can be a security hole or invite DoS attack -+since the opened and once readdir-ed dir (file object) holds its entry -+list and becomes a pressure for system memory. But I'd say it is similar -+to files under /proc or /sys. The virtual files in them also holds a -+memory page (generally) while they are opened. When an idea to reduce -+memory for them is introduced, it will be applied to aufs too. -+For those who really hate this situation, I've developed readdir(3) -+library which operates this merging in userspace. You just need to set -+LD_PRELOAD environment variable, and aufs will not consume no memory in -+kernel space for readdir(3). -+ -+ -+Workqueue -+---------------------------------------------------------------------- -+Aufs sometimes requires privilege access to a branch. For instance, -+in copy-up/down operation. When a user process is going to make changes -+to a file which exists in the lower readonly branch only, and the mode -+of one of ancestor directories may not be writable by a user -+process. Here aufs copy-up the file with its ancestors and they may -+require privilege to set its owner/group/mode/etc. -+This is a typical case of a application character of aufs (see -+Introduction). -+ -+Aufs uses workqueue synchronously for this case. It creates its own -+workqueue. The workqueue is a kernel thread and has privilege. Aufs -+passes the request to call mkdir or write (for example), and wait for -+its completion. This approach solves a problem of a signal handler -+simply. -+If aufs didn't adopt the workqueue and changed the privilege of the -+process, then the process may receive the unexpected SIGXFSZ or other -+signals. -+ -+Also aufs uses the system global workqueue ("events" kernel thread) too -+for asynchronous tasks, such like handling inotify/fsnotify, re-creating a -+whiteout base and etc. This is unrelated to a privilege. -+Most of aufs operation tries acquiring a rw_semaphore for aufs -+superblock at the beginning, at the same time waits for the completion -+of all queued asynchronous tasks. -+ -+ -+Whiteout -+---------------------------------------------------------------------- -+The whiteout in aufs is very similar to Unionfs's. That is represented -+by its filename. UnionMount takes an approach of a file mode, but I am -+afraid several utilities (find(1) or something) will have to support it. -+ -+Basically the whiteout represents "logical deletion" which stops aufs to -+lookup further, but also it represents "dir is opaque" which also stop -+further lookup. -+ -+In aufs, rmdir(2) and rename(2) for dir uses whiteout alternatively. -+In order to make several functions in a single systemcall to be -+revertible, aufs adopts an approach to rename a directory to a temporary -+unique whiteouted name. -+For example, in rename(2) dir where the target dir already existed, aufs -+renames the target dir to a temporary unique whiteouted name before the -+actual rename on a branch, and then handles other actions (make it opaque, -+update the attributes, etc). If an error happens in these actions, aufs -+simply renames the whiteouted name back and returns an error. If all are -+succeeded, aufs registers a function to remove the whiteouted unique -+temporary name completely and asynchronously to the system global -+workqueue. -+ -+ -+Copy-up -+---------------------------------------------------------------------- -+It is a well-known feature or concept. -+When user modifies a file on a readonly branch, aufs operate "copy-up" -+internally and makes change to the new file on the upper writable branch. -+When the trigger systemcall does not update the timestamps of the parent -+dir, aufs reverts it after copy-up. -+ -+ -+Move-down (aufs3.9 and later) -+---------------------------------------------------------------------- -+"Copy-up" is one of the essential feature in aufs. It copies a file from -+the lower readonly branch to the upper writable branch when a user -+changes something about the file. -+"Move-down" is an opposite action of copy-up. Basically this action is -+ran manually instead of automatically and internally. -+For desgin and implementation, aufs has to consider these issues. -+- whiteout for the file may exist on the lower branch. -+- ancestor directories may not exist on the lower branch. -+- diropq for the ancestor directories may exist on the upper branch. -+- free space on the lower branch will reduce. -+- another access to the file may happen during moving-down, including -+ UDBA (see "Revalidate Dentry and UDBA"). -+- the file should not be hard-linked nor pseudo-linked. they should be -+ handled by auplink utility later. -+ -+Sometimes users want to move-down a file from the upper writable branch -+to the lower readonly or writable branch. For instance, -+- the free space of the upper writable branch is going to run out. -+- create a new intermediate branch between the upper and lower branch. -+- etc. -+ -+For this purpose, use "aumvdown" command in aufs-util.git. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/03atomic_open.txt linux-4.0.4/Documentation/filesystems/aufs/design/03atomic_open.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/03atomic_open.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/03atomic_open.txt 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,72 @@ -+ -+# Copyright (C) 2015 Junjiro R. Okajima -+ -+Support for a branch who has its ->atomic_open() -+---------------------------------------------------------------------- -+The filesystems who implement its ->atomic_open() are not majority. For -+example NFSv4 does, and aufs should call NFSv4 ->atomic_open, -+particularly for open(O_CREAT|O_EXCL, 0400) case. Other than -+->atomic_open(), NFSv4 returns an error for this open(2). While I am not -+sure whether all filesystems who have ->atomic_open() behave like this, -+but NFSv4 surely returns the error. -+ -+In order to support ->atomic_open() for aufs, there are a few -+approaches. -+ -+A. Introduce aufs_atomic_open() -+ - calls one of VFS:do_last(), lookup_open() or atomic_open() for -+ branch fs. -+B. Introduce aufs_atomic_open() calling create, open and chmod. this is -+ an aufs user Pip Cet's approach -+ - calls aufs_create(), VFS finish_open() and notify_change(). -+ - pass fake-mode to finish_open(), and then correct the mode by -+ notify_change(). -+C. Extend aufs_open() to call branch fs's ->atomic_open() -+ - no aufs_atomic_open(). -+ - aufs_lookup() registers the TID to an aufs internal object. -+ - aufs_create() does nothing when the matching TID is registered, but -+ registers the mode. -+ - aufs_open() calls branch fs's ->atomic_open() when the matching -+ TID is registered. -+D. Extend aufs_open() to re-try branch fs's ->open() with superuser's -+ credential -+ - no aufs_atomic_open(). -+ - aufs_create() registers the TID to an internal object. this info -+ represents "this process created this file just now." -+ - when aufs gets EACCES from branch fs's ->open(), then confirm the -+ registered TID and re-try open() with superuser's credential. -+ -+Pros and cons for each approach. -+ -+A. -+ - straightforward but highly depends upon VFS internal. -+ - the atomic behavaiour is kept. -+ - some of parameters such as nameidata are hard to reproduce for -+ branch fs. -+ - large overhead. -+B. -+ - easy to implement. -+ - the atomic behavaiour is lost. -+C. -+ - the atomic behavaiour is kept. -+ - dirty and tricky. -+ - VFS checks whether the file is created correctly after calling -+ ->create(), which means this approach doesn't work. -+D. -+ - easy to implement. -+ - the atomic behavaiour is lost. -+ - to open a file with superuser's credential and give it to a user -+ process is a bad idea, since the file object keeps the credential -+ in it. It may affect LSM or something. This approach doesn't work -+ either. -+ -+The approach A is ideal, but it hard to implement. So here is a -+variation of A, which is to be implemented. -+ -+A-1. Introduce aufs_atomic_open() -+ - calls branch fs ->atomic_open() if exists. otherwise calls -+ vfs_create() and finish_open(). -+ - the demerit is that the several checks after branch fs -+ ->atomic_open() are lost. in the ordinary case, the checks are -+ done by VFS:do_last(), lookup_open() and atomic_open(). some can -+ be implemented in aufs, but not all I am afraid. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/03lookup.txt linux-4.0.4/Documentation/filesystems/aufs/design/03lookup.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/03lookup.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/03lookup.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,100 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+Lookup in a Branch -+---------------------------------------------------------------------- -+Since aufs has a character of sub-VFS (see Introduction), it operates -+lookup for branches as VFS does. It may be a heavy work. But almost all -+lookup operation in aufs is the simplest case, ie. lookup only an entry -+directly connected to its parent. Digging down the directory hierarchy -+is unnecessary. VFS has a function lookup_one_len() for that use, and -+aufs calls it. -+ -+When a branch is a remote filesystem, aufs basically relies upon its -+->d_revalidate(), also aufs forces the hardest revalidate tests for -+them. -+For d_revalidate, aufs implements three levels of revalidate tests. See -+"Revalidate Dentry and UDBA" in detail. -+ -+ -+Test Only the Highest One for the Directory Permission (dirperm1 option) -+---------------------------------------------------------------------- -+Let's try case study. -+- aufs has two branches, upper readwrite and lower readonly. -+ /au = /rw + /ro -+- "dirA" exists under /ro, but /rw. and its mode is 0700. -+- user invoked "chmod a+rx /au/dirA" -+- the internal copy-up is activated and "/rw/dirA" is created and its -+ permission bits are set to world readable. -+- then "/au/dirA" becomes world readable? -+ -+In this case, /ro/dirA is still 0700 since it exists in readonly branch, -+or it may be a natively readonly filesystem. If aufs respects the lower -+branch, it should not respond readdir request from other users. But user -+allowed it by chmod. Should really aufs rejects showing the entries -+under /ro/dirA? -+ -+To be honest, I don't have a good solution for this case. So aufs -+implements 'dirperm1' and 'nodirperm1' mount options, and leave it to -+users. -+When dirperm1 is specified, aufs checks only the highest one for the -+directory permission, and shows the entries. Otherwise, as usual, checks -+every dir existing on all branches and rejects the request. -+ -+As a side effect, dirperm1 option improves the performance of aufs -+because the number of permission check is reduced when the number of -+branch is many. -+ -+ -+Revalidate Dentry and UDBA (User's Direct Branch Access) -+---------------------------------------------------------------------- -+Generally VFS helpers re-validate a dentry as a part of lookup. -+0. digging down the directory hierarchy. -+1. lock the parent dir by its i_mutex. -+2. lookup the final (child) entry. -+3. revalidate it. -+4. call the actual operation (create, unlink, etc.) -+5. unlock the parent dir -+ -+If the filesystem implements its ->d_revalidate() (step 3), then it is -+called. Actually aufs implements it and checks the dentry on a branch is -+still valid. -+But it is not enough. Because aufs has to release the lock for the -+parent dir on a branch at the end of ->lookup() (step 2) and -+->d_revalidate() (step 3) while the i_mutex of the aufs dir is still -+held by VFS. -+If the file on a branch is changed directly, eg. bypassing aufs, after -+aufs released the lock, then the subsequent operation may cause -+something unpleasant result. -+ -+This situation is a result of VFS architecture, ->lookup() and -+->d_revalidate() is separated. But I never say it is wrong. It is a good -+design from VFS's point of view. It is just not suitable for sub-VFS -+character in aufs. -+ -+Aufs supports such case by three level of revalidation which is -+selectable by user. -+1. Simple Revalidate -+ Addition to the native flow in VFS's, confirm the child-parent -+ relationship on the branch just after locking the parent dir on the -+ branch in the "actual operation" (step 4). When this validation -+ fails, aufs returns EBUSY. ->d_revalidate() (step 3) in aufs still -+ checks the validation of the dentry on branches. -+2. Monitor Changes Internally by Inotify/Fsnotify -+ Addition to above, in the "actual operation" (step 4) aufs re-lookup -+ the dentry on the branch, and returns EBUSY if it finds different -+ dentry. -+ Additionally, aufs sets the inotify/fsnotify watch for every dir on branches -+ during it is in cache. When the event is notified, aufs registers a -+ function to kernel 'events' thread by schedule_work(). And the -+ function sets some special status to the cached aufs dentry and inode -+ private data. If they are not cached, then aufs has nothing to -+ do. When the same file is accessed through aufs (step 0-3) later, -+ aufs will detect the status and refresh all necessary data. -+ In this mode, aufs has to ignore the event which is fired by aufs -+ itself. -+3. No Extra Validation -+ This is the simplest test and doesn't add any additional revalidation -+ test, and skip the revalidation in step 4. It is useful and improves -+ aufs performance when system surely hide the aufs branches from user, -+ by over-mounting something (or another method). -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/04branch.txt linux-4.0.4/Documentation/filesystems/aufs/design/04branch.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/04branch.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/04branch.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,61 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+Branch Manipulation -+ -+Since aufs supports dynamic branch manipulation, ie. add/remove a branch -+and changing its permission/attribute, there are a lot of works to do. -+ -+ -+Add a Branch -+---------------------------------------------------------------------- -+o Confirm the adding dir exists outside of aufs, including loopback -+ mount, and its various attributes. -+o Initialize the xino file and whiteout bases if necessary. -+ See struct.txt. -+ -+o Check the owner/group/mode of the directory -+ When the owner/group/mode of the adding directory differs from the -+ existing branch, aufs issues a warning because it may impose a -+ security risk. -+ For example, when a upper writable branch has a world writable empty -+ top directory, a malicious user can create any files on the writable -+ branch directly, like copy-up and modify manually. If something like -+ /etc/{passwd,shadow} exists on the lower readonly branch but the upper -+ writable branch, and the writable branch is world-writable, then a -+ malicious guy may create /etc/passwd on the writable branch directly -+ and the infected file will be valid in aufs. -+ I am afraid it can be a security issue, but aufs can do nothing except -+ producing a warning. -+ -+ -+Delete a Branch -+---------------------------------------------------------------------- -+o Confirm the deleting branch is not busy -+ To be general, there is one merit to adopt "remount" interface to -+ manipulate branches. It is to discard caches. At deleting a branch, -+ aufs checks the still cached (and connected) dentries and inodes. If -+ there are any, then they are all in-use. An inode without its -+ corresponding dentry can be alive alone (for example, inotify/fsnotify case). -+ -+ For the cached one, aufs checks whether the same named entry exists on -+ other branches. -+ If the cached one is a directory, because aufs provides a merged view -+ to users, as long as one dir is left on any branch aufs can show the -+ dir to users. In this case, the branch can be removed from aufs. -+ Otherwise aufs rejects deleting the branch. -+ -+ If any file on the deleting branch is opened by aufs, then aufs -+ rejects deleting. -+ -+ -+Modify the Permission of a Branch -+---------------------------------------------------------------------- -+o Re-initialize or remove the xino file and whiteout bases if necessary. -+ See struct.txt. -+ -+o rw --> ro: Confirm the modifying branch is not busy -+ Aufs rejects the request if any of these conditions are true. -+ - a file on the branch is mmap-ed. -+ - a regular file on the branch is opened for write and there is no -+ same named entry on the upper branch. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/05wbr_policy.txt linux-4.0.4/Documentation/filesystems/aufs/design/05wbr_policy.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/05wbr_policy.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/05wbr_policy.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,51 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+Policies to Select One among Multiple Writable Branches -+---------------------------------------------------------------------- -+When the number of writable branch is more than one, aufs has to decide -+the target branch for file creation or copy-up. By default, the highest -+writable branch which has the parent (or ancestor) dir of the target -+file is chosen (top-down-parent policy). -+By user's request, aufs implements some other policies to select the -+writable branch, for file creation several policies, round-robin, -+most-free-space, and other policies. For copy-up, top-down-parent, -+bottom-up-parent, bottom-up and others. -+ -+As expected, the round-robin policy selects the branch in circular. When -+you have two writable branches and creates 10 new files, 5 files will be -+created for each branch. mkdir(2) systemcall is an exception. When you -+create 10 new directories, all will be created on the same branch. -+And the most-free-space policy selects the one which has most free -+space among the writable branches. The amount of free space will be -+checked by aufs internally, and users can specify its time interval. -+ -+The policies for copy-up is more simple, -+top-down-parent is equivalent to the same named on in create policy, -+bottom-up-parent selects the writable branch where the parent dir -+exists and the nearest upper one from the copyup-source, -+bottom-up selects the nearest upper writable branch from the -+copyup-source, regardless the existence of the parent dir. -+ -+There are some rules or exceptions to apply these policies. -+- If there is a readonly branch above the policy-selected branch and -+ the parent dir is marked as opaque (a variation of whiteout), or the -+ target (creating) file is whiteout-ed on the upper readonly branch, -+ then the result of the policy is ignored and the target file will be -+ created on the nearest upper writable branch than the readonly branch. -+- If there is a writable branch above the policy-selected branch and -+ the parent dir is marked as opaque or the target file is whiteouted -+ on the branch, then the result of the policy is ignored and the target -+ file will be created on the highest one among the upper writable -+ branches who has diropq or whiteout. In case of whiteout, aufs removes -+ it as usual. -+- link(2) and rename(2) systemcalls are exceptions in every policy. -+ They try selecting the branch where the source exists as possible -+ since copyup a large file will take long time. If it can't be, -+ ie. the branch where the source exists is readonly, then they will -+ follow the copyup policy. -+- There is an exception for rename(2) when the target exists. -+ If the rename target exists, aufs compares the index of the branches -+ where the source and the target exists and selects the higher -+ one. If the selected branch is readonly, then aufs follows the -+ copyup policy. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/06fhsm.txt linux-4.0.4/Documentation/filesystems/aufs/design/06fhsm.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/06fhsm.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/06fhsm.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,105 @@ -+ -+# Copyright (C) 2011-2015 Junjiro R. Okajima -+ -+File-based Hierarchical Storage Management (FHSM) -+---------------------------------------------------------------------- -+Hierarchical Storage Management (or HSM) is a well-known feature in the -+storage world. Aufs provides this feature as file-based with multiple -+writable branches, based upon the principle of "Colder, the Lower". -+Here the word "colder" means that the less used files, and "lower" means -+that the position in the order of the stacked branches vertically. -+These multiple writable branches are prioritized, ie. the topmost one -+should be the fastest drive and be used heavily. -+ -+o Characters in aufs FHSM story -+- aufs itself and a new branch attribute. -+- a new ioctl interface to move-down and to establish a connection with -+ the daemon ("move-down" is a converse of "copy-up"). -+- userspace tool and daemon. -+ -+The userspace daemon establishes a connection with aufs and waits for -+the notification. The notified information is very similar to struct -+statfs containing the number of consumed blocks and inodes. -+When the consumed blocks/inodes of a branch exceeds the user-specified -+upper watermark, the daemon activates its move-down process until the -+consumed blocks/inodes reaches the user-specified lower watermark. -+ -+The actual move-down is done by aufs based upon the request from -+user-space since we need to maintain the inode number and the internal -+pointer arrays in aufs. -+ -+Currently aufs FHSM handles the regular files only. Additionally they -+must not be hard-linked nor pseudo-linked. -+ -+ -+o Cowork of aufs and the user-space daemon -+ During the userspace daemon established the connection, aufs sends a -+ small notification to it whenever aufs writes something into the -+ writable branch. But it may cost high since aufs issues statfs(2) -+ internally. So user can specify a new option to cache the -+ info. Actually the notification is controlled by these factors. -+ + the specified cache time. -+ + classified as "force" by aufs internally. -+ Until the specified time expires, aufs doesn't send the info -+ except the forced cases. When aufs decide forcing, the info is always -+ notified to userspace. -+ For example, the number of free inodes is generally large enough and -+ the shortage of it happens rarely. So aufs doesn't force the -+ notification when creating a new file, directory and others. This is -+ the typical case which aufs doesn't force. -+ When aufs writes the actual filedata and the files consumes any of new -+ blocks, the aufs forces notifying. -+ -+ -+o Interfaces in aufs -+- New branch attribute. -+ + fhsm -+ Specifies that the branch is managed by FHSM feature. In other word, -+ participant in the FHSM. -+ When nofhsm is set to the branch, it will not be the source/target -+ branch of the move-down operation. This attribute is set -+ independently from coo and moo attributes, and if you want full -+ FHSM, you should specify them as well. -+- New mount option. -+ + fhsm_sec -+ Specifies a second to suppress many less important info to be -+ notified. -+- New ioctl. -+ + AUFS_CTL_FHSM_FD -+ create a new file descriptor which userspace can read the notification -+ (a subset of struct statfs) from aufs. -+- Module parameter 'brs' -+ It has to be set to 1. Otherwise the new mount option 'fhsm' will not -+ be set. -+- mount helpers /sbin/mount.aufs and /sbin/umount.aufs -+ When there are two or more branches with fhsm attributes, -+ /sbin/mount.aufs invokes the user-space daemon and /sbin/umount.aufs -+ terminates it. As a result of remounting and branch-manipulation, the -+ number of branches with fhsm attribute can be one. In this case, -+ /sbin/mount.aufs will terminate the user-space daemon. -+ -+ -+Finally the operation is done as these steps in kernel-space. -+- make sure that, -+ + no one else is using the file. -+ + the file is not hard-linked. -+ + the file is not pseudo-linked. -+ + the file is a regular file. -+ + the parent dir is not opaqued. -+- find the target writable branch. -+- make sure the file is not whiteout-ed by the upper (than the target) -+ branch. -+- make the parent dir on the target branch. -+- mutex lock the inode on the branch. -+- unlink the whiteout on the target branch (if exists). -+- lookup and create the whiteout-ed temporary name on the target branch. -+- copy the file as the whiteout-ed temporary name on the target branch. -+- rename the whiteout-ed temporary name to the original name. -+- unlink the file on the source branch. -+- maintain the internal pointer array and the external inode number -+ table (XINO). -+- maintain the timestamps and other attributes of the parent dir and the -+ file. -+ -+And of course, in every step, an error may happen. So the operation -+should restore the original file state after an error happens. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/06mmap.txt linux-4.0.4/Documentation/filesystems/aufs/design/06mmap.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/06mmap.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/06mmap.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,33 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+mmap(2) -- File Memory Mapping -+---------------------------------------------------------------------- -+In aufs, the file-mapped pages are handled by a branch fs directly, no -+interaction with aufs. It means aufs_mmap() calls the branch fs's -+->mmap(). -+This approach is simple and good, but there is one problem. -+Under /proc, several entries show the mmapped files by its path (with -+device and inode number), and the printed path will be the path on the -+branch fs's instead of virtual aufs's. -+This is not a problem in most cases, but some utilities lsof(1) (and its -+user) may expect the path on aufs. -+ -+To address this issue, aufs adds a new member called vm_prfile in struct -+vm_area_struct (and struct vm_region). The original vm_file points to -+the file on the branch fs in order to handle everything correctly as -+usual. The new vm_prfile points to a virtual file in aufs, and the -+show-functions in procfs refers to vm_prfile if it is set. -+Also we need to maintain several other places where touching vm_file -+such like -+- fork()/clone() copies vma and the reference count of vm_file is -+ incremented. -+- merging vma maintains the ref count too. -+ -+This is not a good approach. It just fakes the printed path. But it -+leaves all behaviour around f_mapping unchanged. This is surely an -+advantage. -+Actually aufs had adopted another complicated approach which calls -+generic_file_mmap() and handles struct vm_operations_struct. In this -+approach, aufs met a hard problem and I could not solve it without -+switching the approach. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/06xattr.txt linux-4.0.4/Documentation/filesystems/aufs/design/06xattr.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/06xattr.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/06xattr.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,81 @@ -+ -+# Copyright (C) 2014-2015 Junjiro R. Okajima -+ -+Listing XATTR/EA and getting the value -+---------------------------------------------------------------------- -+For the inode standard attributes (owner, group, timestamps, etc.), aufs -+shows the values from the topmost existing file. This behaviour is good -+for the non-dir entries since the bahaviour exactly matches the shown -+information. But for the directories, aufs considers all the same named -+entries on the lower branches. Which means, if one of the lower entry -+rejects readdir call, then aufs returns an error even if the topmost -+entry allows it. This behaviour is necessary to respect the branch fs's -+security, but can make users confused since the user-visible standard -+attributes don't match the behaviour. -+To address this issue, aufs has a mount option called dirperm1 which -+checks the permission for the topmost entry only, and ignores the lower -+entry's permission. -+ -+A similar issue can happen around XATTR. -+getxattr(2) and listxattr(2) families behave as if dirperm1 option is -+always set. Otherwise these very unpleasant situation would happen. -+- listxattr(2) may return the duplicated entries. -+- users may not be able to remove or reset the XATTR forever, -+ -+ -+XATTR/EA support in the internal (copy,move)-(up,down) -+---------------------------------------------------------------------- -+Generally the extended attributes of inode are categorized as these. -+- "security" for LSM and capability. -+- "system" for posix ACL, 'acl' mount option is required for the branch -+ fs generally. -+- "trusted" for userspace, CAP_SYS_ADMIN is required. -+- "user" for userspace, 'user_xattr' mount option is required for the -+ branch fs generally. -+ -+Moreover there are some other categories. Aufs handles these rather -+unpopular categories as the ordinary ones, ie. there is no special -+condition nor exception. -+ -+In copy-up, the support for XATTR on the dst branch may differ from the -+src branch. In this case, the copy-up operation will get an error and -+the original user operation which triggered the copy-up will fail. It -+can happen that even all copy-up will fail. -+When both of src and dst branches support XATTR and if an error occurs -+during copying XATTR, then the copy-up should fail obviously. That is a -+good reason and aufs should return an error to userspace. But when only -+the src branch support that XATTR, aufs should not return an error. -+For example, the src branch supports ACL but the dst branch doesn't -+because the dst branch may natively un-support it or temporary -+un-support it due to "noacl" mount option. Of course, the dst branch fs -+may NOT return an error even if the XATTR is not supported. It is -+totally up to the branch fs. -+ -+Anyway when the aufs internal copy-up gets an error from the dst branch -+fs, then aufs tries removing the just copied entry and returns the error -+to the userspace. The worst case of this situation will be all copy-up -+will fail. -+ -+For the copy-up operation, there two basic approaches. -+- copy the specified XATTR only (by category above), and return the -+ error unconditionally if it happens. -+- copy all XATTR, and ignore the error on the specified category only. -+ -+In order to support XATTR and to implement the correct behaviour, aufs -+chooses the latter approach and introduces some new branch attributes, -+"icexsec", "icexsys", "icextr", "icexusr", and "icexoth". -+They correspond to the XATTR namespaces (see above). Additionally, to be -+convenient, "icex" is also provided which means all "icex*" attributes -+are set (here the word "icex" stands for "ignore copy-error on XATTR"). -+ -+The meaning of these attributes is to ignore the error from setting -+XATTR on that branch. -+Note that aufs tries copying all XATTR unconditionally, and ignores the -+error from the dst branch according to the specified attributes. -+ -+Some XATTR may have its default value. The default value may come from -+the parent dir or the environment. If the default value is set at the -+file creating-time, it will be overwritten by copy-up. -+Some contradiction may happen I am afraid. -+Do we need another attribute to stop copying XATTR? I am unsure. For -+now, aufs implements the branch attributes to ignore the error. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/07export.txt linux-4.0.4/Documentation/filesystems/aufs/design/07export.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/07export.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/07export.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,45 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+Export Aufs via NFS -+---------------------------------------------------------------------- -+Here is an approach. -+- like xino/xib, add a new file 'xigen' which stores aufs inode -+ generation. -+- iget_locked(): initialize aufs inode generation for a new inode, and -+ store it in xigen file. -+- destroy_inode(): increment aufs inode generation and store it in xigen -+ file. it is necessary even if it is not unlinked, because any data of -+ inode may be changed by UDBA. -+- encode_fh(): for a root dir, simply return FILEID_ROOT. otherwise -+ build file handle by -+ + branch id (4 bytes) -+ + superblock generation (4 bytes) -+ + inode number (4 or 8 bytes) -+ + parent dir inode number (4 or 8 bytes) -+ + inode generation (4 bytes)) -+ + return value of exportfs_encode_fh() for the parent on a branch (4 -+ bytes) -+ + file handle for a branch (by exportfs_encode_fh()) -+- fh_to_dentry(): -+ + find the index of a branch from its id in handle, and check it is -+ still exist in aufs. -+ + 1st level: get the inode number from handle and search it in cache. -+ + 2nd level: if not found in cache, get the parent inode number from -+ the handle and search it in cache. and then open the found parent -+ dir, find the matching inode number by vfs_readdir() and get its -+ name, and call lookup_one_len() for the target dentry. -+ + 3rd level: if the parent dir is not cached, call -+ exportfs_decode_fh() for a branch and get the parent on a branch, -+ build a pathname of it, convert it a pathname in aufs, call -+ path_lookup(). now aufs gets a parent dir dentry, then handle it as -+ the 2nd level. -+ + to open the dir, aufs needs struct vfsmount. aufs keeps vfsmount -+ for every branch, but not itself. to get this, (currently) aufs -+ searches in current->nsproxy->mnt_ns list. it may not be a good -+ idea, but I didn't get other approach. -+ + test the generation of the gotten inode. -+- every inode operation: they may get EBUSY due to UDBA. in this case, -+ convert it into ESTALE for NFSD. -+- readdir(): call lockdep_on/off() because filldir in NFSD calls -+ lookup_one_len(), vfs_getattr(), encode_fh() and others. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/08shwh.txt linux-4.0.4/Documentation/filesystems/aufs/design/08shwh.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/08shwh.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/08shwh.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,39 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+Show Whiteout Mode (shwh) -+---------------------------------------------------------------------- -+Generally aufs hides the name of whiteouts. But in some cases, to show -+them is very useful for users. For instance, creating a new middle layer -+(branch) by merging existing layers. -+ -+(borrowing aufs1 HOW-TO from a user, Michael Towers) -+When you have three branches, -+- Bottom: 'system', squashfs (underlying base system), read-only -+- Middle: 'mods', squashfs, read-only -+- Top: 'overlay', ram (tmpfs), read-write -+ -+The top layer is loaded at boot time and saved at shutdown, to preserve -+the changes made to the system during the session. -+When larger changes have been made, or smaller changes have accumulated, -+the size of the saved top layer data grows. At this point, it would be -+nice to be able to merge the two overlay branches ('mods' and 'overlay') -+and rewrite the 'mods' squashfs, clearing the top layer and thus -+restoring save and load speed. -+ -+This merging is simplified by the use of another aufs mount, of just the -+two overlay branches using the 'shwh' option. -+# mount -t aufs -o ro,shwh,br:/livesys/overlay=ro+wh:/livesys/mods=rr+wh \ -+ aufs /livesys/merge_union -+ -+A merged view of these two branches is then available at -+/livesys/merge_union, and the new feature is that the whiteouts are -+visible! -+Note that in 'shwh' mode the aufs mount must be 'ro', which will disable -+writing to all branches. Also the default mode for all branches is 'ro'. -+It is now possible to save the combined contents of the two overlay -+branches to a new squashfs, e.g.: -+# mksquashfs /livesys/merge_union /path/to/newmods.squash -+ -+This new squashfs archive can be stored on the boot device and the -+initramfs will use it to replace the old one at the next boot. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/design/10dynop.txt linux-4.0.4/Documentation/filesystems/aufs/design/10dynop.txt ---- linux-4.0.4.orig/Documentation/filesystems/aufs/design/10dynop.txt 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/design/10dynop.txt 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,34 @@ -+ -+# Copyright (C) 2010-2015 Junjiro R. Okajima -+ -+Dynamically customizable FS operations -+---------------------------------------------------------------------- -+Generally FS operations (struct inode_operations, struct -+address_space_operations, struct file_operations, etc.) are defined as -+"static const", but it never means that FS have only one set of -+operation. Some FS have multiple sets of them. For instance, ext2 has -+three sets, one for XIP, for NOBH, and for normal. -+Since aufs overrides and redirects these operations, sometimes aufs has -+to change its behaviour according to the branch FS type. More importantly -+VFS acts differently if a function (member in the struct) is set or -+not. It means aufs should have several sets of operations and select one -+among them according to the branch FS definition. -+ -+In order to solve this problem and not to affect the behaviour of VFS, -+aufs defines these operations dynamically. For instance, aufs defines -+dummy direct_IO function for struct address_space_operations, but it may -+not be set to the address_space_operations actually. When the branch FS -+doesn't have it, aufs doesn't set it to its address_space_operations -+while the function definition itself is still alive. So the behaviour -+itself will not change, and it will return an error when direct_IO is -+not set. -+ -+The lifetime of these dynamically generated operation object is -+maintained by aufs branch object. When the branch is removed from aufs, -+the reference counter of the object is decremented. When it reaches -+zero, the dynamically generated operation object will be freed. -+ -+This approach is designed to support AIO (io_submit), Direct I/O and -+XIP (DAX) mainly. -+Currently this approach is applied to address_space_operations for -+regular files only. -diff -Nur linux-4.0.4.orig/Documentation/filesystems/aufs/README linux-4.0.4/Documentation/filesystems/aufs/README ---- linux-4.0.4.orig/Documentation/filesystems/aufs/README 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/Documentation/filesystems/aufs/README 2015-05-30 22:11:29.000000000 +0200 -@@ -0,0 +1,383 @@ -+ -+Aufs4 -- advanced multi layered unification filesystem version 4.x -+http://aufs.sf.net -+Junjiro R. Okajima -+ -+ -+0. Introduction -+---------------------------------------- -+In the early days, aufs was entirely re-designed and re-implemented -+Unionfs Version 1.x series. Adding many original ideas, approaches, -+improvements and implementations, it becomes totally different from -+Unionfs while keeping the basic features. -+Recently, Unionfs Version 2.x series begin taking some of the same -+approaches to aufs1's. -+Unionfs is being developed by Professor Erez Zadok at Stony Brook -+University and his team. -+ -+Aufs4 supports linux-4.0 and later, and for linux-3.x series try aufs3. -+If you want older kernel version support, try aufs2-2.6.git or -+aufs2-standalone.git repository, aufs1 from CVS on SourceForge. -+ -+Note: it becomes clear that "Aufs was rejected. Let's give it up." -+ According to Christoph Hellwig, linux rejects all union-type -+ filesystems but UnionMount. -+ -+ -+PS. Al Viro seems have a plan to merge aufs as well as overlayfs and -+ UnionMount, and he pointed out an issue around a directory mutex -+ lock and aufs addressed it. But it is still unsure whether aufs will -+ be merged (or any other union solution). -+ -+ -+ -+1. Features -+---------------------------------------- -+- unite several directories into a single virtual filesystem. The member -+ directory is called as a branch. -+- you can specify the permission flags to the branch, which are 'readonly', -+ 'readwrite' and 'whiteout-able.' -+- by upper writable branch, internal copyup and whiteout, files/dirs on -+ readonly branch are modifiable logically. -+- dynamic branch manipulation, add, del. -+- etc... -+ -+Also there are many enhancements in aufs, such as: -+- test only the highest one for the directory permission (dirperm1) -+- copyup on open (coo=) -+- 'move' policy for copy-up between two writable branches, after -+ checking free space. -+- xattr, acl -+- readdir(3) in userspace. -+- keep inode number by external inode number table -+- keep the timestamps of file/dir in internal copyup operation -+- seekable directory, supporting NFS readdir. -+- whiteout is hardlinked in order to reduce the consumption of inodes -+ on branch -+- do not copyup, nor create a whiteout when it is unnecessary -+- revert a single systemcall when an error occurs in aufs -+- remount interface instead of ioctl -+- maintain /etc/mtab by an external command, /sbin/mount.aufs. -+- loopback mounted filesystem as a branch -+- kernel thread for removing the dir who has a plenty of whiteouts -+- support copyup sparse file (a file which has a 'hole' in it) -+- default permission flags for branches -+- selectable permission flags for ro branch, whether whiteout can -+ exist or not -+- export via NFS. -+- support /fs/aufs and /aufs. -+- support multiple writable branches, some policies to select one -+ among multiple writable branches. -+- a new semantics for link(2) and rename(2) to support multiple -+ writable branches. -+- no glibc changes are required. -+- pseudo hardlink (hardlink over branches) -+- allow a direct access manually to a file on branch, e.g. bypassing aufs. -+ including NFS or remote filesystem branch. -+- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX. -+- and more... -+ -+Currently these features are dropped temporary from aufs4. -+See design/08plan.txt in detail. -+- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs -+ (robr) -+- statistics of aufs thread (/sys/fs/aufs/stat) -+ -+Features or just an idea in the future (see also design/*.txt), -+- reorder the branch index without del/re-add. -+- permanent xino files for NFSD -+- an option for refreshing the opened files after add/del branches -+- light version, without branch manipulation. (unnecessary?) -+- copyup in userspace -+- inotify in userspace -+- readv/writev -+ -+ -+2. Download -+---------------------------------------- -+There are three GIT trees for aufs4, aufs4-linux.git, -+aufs4-standalone.git, and aufs-util.git. Note that there is no "4" in -+"aufs-util.git." -+While the aufs-util is always necessary, you need either of aufs4-linux -+or aufs4-standalone. -+ -+The aufs4-linux tree includes the whole linux mainline GIT tree, -+git://git.kernel.org/.../torvalds/linux.git. -+And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot -+build aufs4 as an external kernel module. -+Several extra patches are not included in this tree. Only -+aufs4-standalone tree contains them. They are describe in the later -+section "Configuration and Compilation." -+ -+On the other hand, the aufs4-standalone tree has only aufs source files -+and necessary patches, and you can select CONFIG_AUFS_FS=m. -+But you need to apply all aufs patches manually. -+ -+You will find GIT branches whose name is in form of "aufs4.x" where "x" -+represents the linux kernel version, "linux-4.x". For instance, -+"aufs4.0" is for linux-4.0. For latest "linux-4.x-rcN", use -+"aufs4.x-rcN" branch. -+ -+o aufs4-linux tree -+$ git clone --reference /your/linux/git/tree \ -+ git://github.com/sfjro/aufs4-linux.git aufs4-linux.git -+- if you don't have linux GIT tree, then remove "--reference ..." -+$ cd aufs4-linux.git -+$ git checkout origin/aufs4.0 -+ -+Or You may want to directly git-pull aufs into your linux GIT tree, and -+leave the patch-work to GIT. -+$ cd /your/linux/git/tree -+$ git remote add aufs4 git://github.com/sfjro/aufs4-linux.git -+$ git fetch aufs4 -+$ git checkout -b my4.0 v4.0 -+$ (add your local change...) -+$ git pull aufs4 aufs4.0 -+- now you have v4.0 + your_changes + aufs4.0 in you my4.0 branch. -+- you may need to solve some conflicts between your_changes and -+ aufs4.0. in this case, git-rerere is recommended so that you can -+ solve the similar conflicts automatically when you upgrade to 4.1 or -+ later in the future. -+ -+o aufs4-standalone tree -+$ git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone.git -+$ cd aufs4-standalone.git -+$ git checkout origin/aufs4.0 -+ -+o aufs-util tree -+$ git clone git://git.code.sf.net/p/aufs/aufs-util aufs-util.git -+- note that the public aufs-util.git is on SourceForge instead of -+ GitHUB. -+$ cd aufs-util.git -+$ git checkout origin/aufs4.0 -+ -+Note: The 4.x-rcN branch is to be used with `rc' kernel versions ONLY. -+The minor version number, 'x' in '4.x', of aufs may not always -+follow the minor version number of the kernel. -+Because changes in the kernel that cause the use of a new -+minor version number do not always require changes to aufs-util. -+ -+Since aufs-util has its own minor version number, you may not be -+able to find a GIT branch in aufs-util for your kernel's -+exact minor version number. -+In this case, you should git-checkout the branch for the -+nearest lower number. -+ -+For (an unreleased) example: -+If you are using "linux-4.10" and the "aufs4.10" branch -+does not exist in aufs-util repository, then "aufs4.9", "aufs4.8" -+or something numerically smaller is the branch for your kernel. -+ -+Also you can view all branches by -+ $ git branch -a -+ -+ -+3. Configuration and Compilation -+---------------------------------------- -+Make sure you have git-checkout'ed the correct branch. -+ -+For aufs4-linux tree, -+- enable CONFIG_AUFS_FS. -+- set other aufs configurations if necessary. -+ -+For aufs4-standalone tree, -+There are several ways to build. -+ -+1. -+- apply ./aufs4-kbuild.patch to your kernel source files. -+- apply ./aufs4-base.patch too. -+- apply ./aufs4-mmap.patch too. -+- apply ./aufs4-standalone.patch too, if you have a plan to set -+ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs4-standalone.patch. -+- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your -+ kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild. -+- enable CONFIG_AUFS_FS, you can select either -+ =m or =y. -+- and build your kernel as usual. -+- install the built kernel. -+ Note: Since linux-3.9, every filesystem module requires an alias -+ "fs-". You should make sure that "fs-aufs" is listed in your -+ modules.aliases file if you set CONFIG_AUFS_FS=m. -+- install the header files too by "make headers_install" to the -+ directory where you specify. By default, it is $PWD/usr. -+ "make help" shows a brief note for headers_install. -+- and reboot your system. -+ -+2. -+- module only (CONFIG_AUFS_FS=m). -+- apply ./aufs4-base.patch to your kernel source files. -+- apply ./aufs4-mmap.patch too. -+- apply ./aufs4-standalone.patch too. -+- build your kernel, don't forget "make headers_install", and reboot. -+- edit ./config.mk and set other aufs configurations if necessary. -+ Note: You should read $PWD/fs/aufs/Kconfig carefully which describes -+ every aufs configurations. -+- build the module by simple "make". -+ Note: Since linux-3.9, every filesystem module requires an alias -+ "fs-". You should make sure that "fs-aufs" is listed in your -+ modules.aliases file. -+- you can specify ${KDIR} make variable which points to your kernel -+ source tree. -+- install the files -+ + run "make install" to install the aufs module, or copy the built -+ $PWD/aufs.ko to /lib/modules/... and run depmod -a (or reboot simply). -+ + run "make install_headers" (instead of headers_install) to install -+ the modified aufs header file (you can specify DESTDIR which is -+ available in aufs standalone version's Makefile only), or copy -+ $PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever -+ you like manually. By default, the target directory is $PWD/usr. -+- no need to apply aufs4-kbuild.patch, nor copying source files to your -+ kernel source tree. -+ -+Note: The header file aufs_type.h is necessary to build aufs-util -+ as well as "make headers_install" in the kernel source tree. -+ headers_install is subject to be forgotten, but it is essentially -+ necessary, not only for building aufs-util. -+ You may not meet problems without headers_install in some older -+ version though. -+ -+And then, -+- read README in aufs-util, build and install it -+- note that your distribution may contain an obsoleted version of -+ aufs_type.h in /usr/include/linux or something. When you build aufs -+ utilities, make sure that your compiler refers the correct aufs header -+ file which is built by "make headers_install." -+- if you want to use readdir(3) in userspace or pathconf(3) wrapper, -+ then run "make install_ulib" too. And refer to the aufs manual in -+ detail. -+ -+There several other patches in aufs4-standalone.git. They are all -+optional. When you meet some problems, they will help you. -+- aufs4-loopback.patch -+ Supports a nested loopback mount in a branch-fs. This patch is -+ unnecessary until aufs produces a message like "you may want to try -+ another patch for loopback file". -+- vfs-ino.patch -+ Modifies a system global kernel internal function get_next_ino() in -+ order to stop assigning 0 for an inode-number. Not directly related to -+ aufs, but recommended generally. -+- tmpfs-idr.patch -+ Keeps the tmpfs inode number as the lowest value. Effective to reduce -+ the size of aufs XINO files for tmpfs branch. Also it prevents the -+ duplication of inode number, which is important for backup tools and -+ other utilities. When you find aufs XINO files for tmpfs branch -+ growing too much, try this patch. -+ -+ -+4. Usage -+---------------------------------------- -+At first, make sure aufs-util are installed, and please read the aufs -+manual, aufs.5 in aufs-util.git tree. -+$ man -l aufs.5 -+ -+And then, -+$ mkdir /tmp/rw /tmp/aufs -+# mount -t aufs -o br=/tmp/rw:${HOME} none /tmp/aufs -+ -+Here is another example. The result is equivalent. -+# mount -t aufs -o br=/tmp/rw=rw:${HOME}=ro none /tmp/aufs -+ Or -+# mount -t aufs -o br:/tmp/rw none /tmp/aufs -+# mount -o remount,append:${HOME} /tmp/aufs -+ -+Then, you can see whole tree of your home dir through /tmp/aufs. If -+you modify a file under /tmp/aufs, the one on your home directory is -+not affected, instead the same named file will be newly created under -+/tmp/rw. And all of your modification to a file will be applied to -+the one under /tmp/rw. This is called the file based Copy on Write -+(COW) method. -+Aufs mount options are described in aufs.5. -+If you run chroot or something and make your aufs as a root directory, -+then you need to customize the shutdown script. See the aufs manual in -+detail. -+ -+Additionally, there are some sample usages of aufs which are a -+diskless system with network booting, and LiveCD over NFS. -+See sample dir in CVS tree on SourceForge. -+ -+ -+5. Contact -+---------------------------------------- -+When you have any problems or strange behaviour in aufs, please let me -+know with: -+- /proc/mounts (instead of the output of mount(8)) -+- /sys/module/aufs/* -+- /sys/fs/aufs/* (if you have them) -+- /debug/aufs/* (if you have them) -+- linux kernel version -+ if your kernel is not plain, for example modified by distributor, -+ the url where i can download its source is necessary too. -+- aufs version which was printed at loading the module or booting the -+ system, instead of the date you downloaded. -+- configuration (define/undefine CONFIG_AUFS_xxx) -+- kernel configuration or /proc/config.gz (if you have it) -+- behaviour which you think to be incorrect -+- actual operation, reproducible one is better -+- mailto: aufs-users at lists.sourceforge.net -+ -+Usually, I don't watch the Public Areas(Bugs, Support Requests, Patches, -+and Feature Requests) on SourceForge. Please join and write to -+aufs-users ML. -+ -+ -+6. Acknowledgements -+---------------------------------------- -+Thanks to everyone who have tried and are using aufs, whoever -+have reported a bug or any feedback. -+ -+Especially donators: -+Tomas Matejicek(slax.org) made a donation (much more than once). -+ Since Apr 2010, Tomas M (the author of Slax and Linux Live -+ scripts) is making "doubling" donations. -+ Unfortunately I cannot list all of the donators, but I really -+ appreciate. -+ It ends Aug 2010, but the ordinary donation URL is still available. -+ -+Dai Itasaka made a donation (2007/8). -+Chuck Smith made a donation (2008/4, 10 and 12). -+Henk Schoneveld made a donation (2008/9). -+Chih-Wei Huang, ASUS, CTC donated Eee PC 4G (2008/10). -+Francois Dupoux made a donation (2008/11). -+Bruno Cesar Ribas and Luis Carlos Erpen de Bona, C3SL serves public -+ aufs2 GIT tree (2009/2). -+William Grant made a donation (2009/3). -+Patrick Lane made a donation (2009/4). -+The Mail Archive (mail-archive.com) made donations (2009/5). -+Nippy Networks (Ed Wildgoose) made a donation (2009/7). -+New Dream Network, LLC (www.dreamhost.com) made a donation (2009/11). -+Pavel Pronskiy made a donation (2011/2). -+Iridium and Inmarsat satellite phone retailer (www.mailasail.com), Nippy -+ Networks (Ed Wildgoose) made a donation for hardware (2011/3). -+Max Lekomcev (DOM-TV project) made a donation (2011/7, 12, 2012/3, 6 and -+11). -+Sam Liddicott made a donation (2011/9). -+Era Scarecrow made a donation (2013/4). -+Bor Ratajc made a donation (2013/4). -+Alessandro Gorreta made a donation (2013/4). -+POIRETTE Marc made a donation (2013/4). -+Alessandro Gorreta made a donation (2013/4). -+lauri kasvandik made a donation (2013/5). -+"pemasu from Finland" made a donation (2013/7). -+The Parted Magic Project made a donation (2013/9 and 11). -+Pavel Barta made a donation (2013/10). -+Nikolay Pertsev made a donation (2014/5). -+James B made a donation (2014/7). -+Stefano Di Biase made a donation (2014/8). -+Daniel Epellei made a donation (2015/1). -+ -+Thank you very much. -+Donations are always, including future donations, very important and -+helpful for me to keep on developing aufs. -+ -+ -+7. -+---------------------------------------- -+If you are an experienced user, no explanation is needed. Aufs is -+just a linux filesystem. -+ -+ -+Enjoy! -+ -+# Local variables: ; -+# mode: text; -+# End: ; -diff -Nur linux-4.0.4.orig/drivers/block/loop.c linux-4.0.4/drivers/block/loop.c ---- linux-4.0.4.orig/drivers/block/loop.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/drivers/block/loop.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/drivers/block/loop.c linux-4.0.5/drivers/block/loop.c +--- linux-4.0.5.orig/drivers/block/loop.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/drivers/block/loop.c 2015-06-21 14:08:17.146432521 -0500 @@ -592,6 +592,24 @@ return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR; } @@ -1573,12 +26,25 @@ diff -Nur linux-4.0.4.orig/drivers/block/loop.c linux-4.0.4/drivers/block/loop.c /* loop sysfs attributes */ static ssize_t loop_attr_show(struct device *dev, char *page, -diff -Nur linux-4.0.4.orig/fs/aufs/aufs.h linux-4.0.4/fs/aufs/aufs.h ---- linux-4.0.4.orig/fs/aufs/aufs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/aufs.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,46 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/aufs.h linux-4.0.5/fs/aufs/aufs.h +--- linux-4.0.5.orig/fs/aufs/aufs.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/aufs.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,59 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -1623,12 +89,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/aufs.h linux-4.0.4/fs/aufs/aufs.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/branch.c linux-4.0.4/fs/aufs/branch.c ---- linux-4.0.4.orig/fs/aufs/branch.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/branch.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,1393 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/branch.c linux-4.0.5/fs/aufs/branch.c +--- linux-4.0.5.orig/fs/aufs/branch.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/branch.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,1406 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -3020,12 +1499,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/branch.c linux-4.0.4/fs/aufs/branch.c + + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/branch.h linux-4.0.4/fs/aufs/branch.h ---- linux-4.0.4.orig/fs/aufs/branch.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/branch.h 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,266 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/branch.h linux-4.0.5/fs/aufs/branch.h +--- linux-4.0.5.orig/fs/aufs/branch.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/branch.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,279 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -3290,12 +1782,67 @@ diff -Nur linux-4.0.4.orig/fs/aufs/branch.h linux-4.0.4/fs/aufs/branch.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_BRANCH_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/cpup.c linux-4.0.4/fs/aufs/cpup.c ---- linux-4.0.4.orig/fs/aufs/cpup.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/cpup.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,1295 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/conf.mk linux-4.0.5/fs/aufs/conf.mk +--- linux-4.0.5.orig/fs/aufs/conf.mk 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/conf.mk 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,38 @@ ++ ++AuConfStr = CONFIG_AUFS_FS=${CONFIG_AUFS_FS} ++ ++define AuConf ++ifdef ${1} ++AuConfStr += ${1}=${${1}} ++endif ++endef ++ ++AuConfAll = BRANCH_MAX_127 BRANCH_MAX_511 BRANCH_MAX_1023 BRANCH_MAX_32767 \ ++ SBILIST \ ++ HNOTIFY HFSNOTIFY \ ++ EXPORT INO_T_64 \ ++ XATTR \ ++ FHSM \ ++ RDU \ ++ SHWH \ ++ BR_RAMFS \ ++ BR_FUSE POLL \ ++ BR_HFSPLUS \ ++ BDEV_LOOP \ ++ DEBUG MAGIC_SYSRQ ++$(foreach i, ${AuConfAll}, \ ++ $(eval $(call AuConf,CONFIG_AUFS_${i}))) ++ ++AuConfName = ${obj}/conf.str ++${AuConfName}.tmp: FORCE ++ @echo ${AuConfStr} | tr ' ' '\n' | sed -e 's/^/"/' -e 's/$$/\\n"/' > $@ ++${AuConfName}: ${AuConfName}.tmp ++ @diff -q $< $@ > /dev/null 2>&1 || { \ ++ echo ' GEN ' $@; \ ++ cp -p $< $@; \ ++ } ++FORCE: ++clean-files += ${AuConfName} ${AuConfName}.tmp ++${obj}/sysfs.o: ${AuConfName} ++ ++-include ${srctree}/${src}/conf_priv.mk +diff -Nur linux-4.0.5.orig/fs/aufs/cpup.c linux-4.0.5/fs/aufs/cpup.c +--- linux-4.0.5.orig/fs/aufs/cpup.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/cpup.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,1308 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -4589,12 +3136,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/cpup.c linux-4.0.4/fs/aufs/cpup.c + dput(parent); + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/cpup.h linux-4.0.4/fs/aufs/cpup.h ---- linux-4.0.4.orig/fs/aufs/cpup.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/cpup.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,81 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/cpup.h linux-4.0.5/fs/aufs/cpup.h +--- linux-4.0.5.orig/fs/aufs/cpup.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/cpup.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,94 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -4674,12 +3234,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/cpup.h linux-4.0.4/fs/aufs/cpup.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_CPUP_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/dbgaufs.c linux-4.0.4/fs/aufs/dbgaufs.c ---- linux-4.0.4.orig/fs/aufs/dbgaufs.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dbgaufs.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,419 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dbgaufs.c linux-4.0.5/fs/aufs/dbgaufs.c +--- linux-4.0.5.orig/fs/aufs/dbgaufs.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dbgaufs.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,432 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -5097,12 +3670,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dbgaufs.c linux-4.0.4/fs/aufs/dbgaufs.c + err = 0; + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/dbgaufs.h linux-4.0.4/fs/aufs/dbgaufs.h ---- linux-4.0.4.orig/fs/aufs/dbgaufs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dbgaufs.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,35 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dbgaufs.h linux-4.0.5/fs/aufs/dbgaufs.h +--- linux-4.0.5.orig/fs/aufs/dbgaufs.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dbgaufs.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,48 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -5136,12 +3722,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dbgaufs.h linux-4.0.4/fs/aufs/dbgaufs.h + +#endif /* __KERNEL__ */ +#endif /* __DBGAUFS_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/dcsub.c linux-4.0.4/fs/aufs/dcsub.c ---- linux-4.0.4.orig/fs/aufs/dcsub.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dcsub.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,211 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dcsub.c linux-4.0.5/fs/aufs/dcsub.c +--- linux-4.0.5.orig/fs/aufs/dcsub.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dcsub.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,224 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -5351,12 +3950,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dcsub.c linux-4.0.4/fs/aufs/dcsub.c + + return path_is_under(path + 0, path + 1); +} -diff -Nur linux-4.0.4.orig/fs/aufs/dcsub.h linux-4.0.4/fs/aufs/dcsub.h ---- linux-4.0.4.orig/fs/aufs/dcsub.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dcsub.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,119 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dcsub.h linux-4.0.5/fs/aufs/dcsub.h +--- linux-4.0.5.orig/fs/aufs/dcsub.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dcsub.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,132 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -5474,12 +4086,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dcsub.h linux-4.0.4/fs/aufs/dcsub.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DCSUB_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/debug.c linux-4.0.4/fs/aufs/debug.c ---- linux-4.0.4.orig/fs/aufs/debug.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/debug.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,425 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/debug.c linux-4.0.5/fs/aufs/debug.c +--- linux-4.0.5.orig/fs/aufs/debug.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/debug.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,438 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -5903,12 +4528,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/debug.c linux-4.0.4/fs/aufs/debug.c + + return 0; +} -diff -Nur linux-4.0.4.orig/fs/aufs/debug.h linux-4.0.4/fs/aufs/debug.h ---- linux-4.0.4.orig/fs/aufs/debug.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/debug.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,212 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/debug.h linux-4.0.5/fs/aufs/debug.h +--- linux-4.0.5.orig/fs/aufs/debug.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/debug.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,225 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -6119,12 +4757,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/debug.h linux-4.0.4/fs/aufs/debug.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DEBUG_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/dentry.c linux-4.0.4/fs/aufs/dentry.c ---- linux-4.0.4.orig/fs/aufs/dentry.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dentry.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,1084 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dentry.c linux-4.0.5/fs/aufs/dentry.c +--- linux-4.0.5.orig/fs/aufs/dentry.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dentry.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,1097 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -7207,12 +5858,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dentry.c linux-4.0.4/fs/aufs/dentry.c + .d_weak_revalidate = aufs_d_revalidate, + .d_release = aufs_d_release +}; -diff -Nur linux-4.0.4.orig/fs/aufs/dentry.h linux-4.0.4/fs/aufs/dentry.h ---- linux-4.0.4.orig/fs/aufs/dentry.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dentry.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,220 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dentry.h linux-4.0.5/fs/aufs/dentry.h +--- linux-4.0.5.orig/fs/aufs/dentry.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dentry.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,233 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -7431,12 +6095,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dentry.h linux-4.0.4/fs/aufs/dentry.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DENTRY_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/dinfo.c linux-4.0.4/fs/aufs/dinfo.c ---- linux-4.0.4.orig/fs/aufs/dinfo.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dinfo.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,531 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dinfo.c linux-4.0.5/fs/aufs/dinfo.c +--- linux-4.0.5.orig/fs/aufs/dinfo.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dinfo.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,544 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -7966,12 +6643,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dinfo.c linux-4.0.4/fs/aufs/dinfo.c + return bindex; + return -1; +} -diff -Nur linux-4.0.4.orig/fs/aufs/dir.c linux-4.0.4/fs/aufs/dir.c ---- linux-4.0.4.orig/fs/aufs/dir.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dir.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,738 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dir.c linux-4.0.5/fs/aufs/dir.c +--- linux-4.0.5.orig/fs/aufs/dir.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dir.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,751 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -8370,8 +7060,8 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dir.c linux-4.0.4/fs/aufs/dir.c + if (unlikely(err)) + goto out; + -+ sb = file->f_path.dentry->d_sb; + inode = file_inode(file); ++ sb = inode->i_sb; + bend = au_fbend_dir(file); + for (bindex = au_fbstart(file); !err && bindex <= bend; bindex++) { + h_file = au_hf_dir(file, bindex); @@ -8708,12 +7398,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dir.c linux-4.0.4/fs/aufs/dir.c + .flush = aufs_flush_dir, + .fsync = aufs_fsync_dir +}; -diff -Nur linux-4.0.4.orig/fs/aufs/dir.h linux-4.0.4/fs/aufs/dir.h ---- linux-4.0.4.orig/fs/aufs/dir.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dir.h 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,118 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dir.h linux-4.0.5/fs/aufs/dir.h +--- linux-4.0.5.orig/fs/aufs/dir.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dir.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,131 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -8830,12 +7533,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dir.h linux-4.0.4/fs/aufs/dir.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DIR_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/dynop.c linux-4.0.4/fs/aufs/dynop.c ---- linux-4.0.4.orig/fs/aufs/dynop.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dynop.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,356 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dynop.c linux-4.0.5/fs/aufs/dynop.c +--- linux-4.0.5.orig/fs/aufs/dynop.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dynop.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,369 @@ +/* + * Copyright (C) 2010-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -9190,12 +7906,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dynop.c linux-4.0.4/fs/aufs/dynop.c + for (i = 0; i < AuDyLast; i++) + WARN_ON(!list_empty(&dynop[i].head)); +} -diff -Nur linux-4.0.4.orig/fs/aufs/dynop.h linux-4.0.4/fs/aufs/dynop.h ---- linux-4.0.4.orig/fs/aufs/dynop.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/dynop.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,61 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/dynop.h linux-4.0.5/fs/aufs/dynop.h +--- linux-4.0.5.orig/fs/aufs/dynop.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/dynop.h 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,74 @@ +/* + * Copyright (C) 2010-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -9255,12 +7984,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/dynop.h linux-4.0.4/fs/aufs/dynop.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_DYNOP_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/export.c linux-4.0.4/fs/aufs/export.c ---- linux-4.0.4.orig/fs/aufs/export.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/export.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,818 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/export.c linux-4.0.5/fs/aufs/export.c +--- linux-4.0.5.orig/fs/aufs/export.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/export.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,831 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -10077,12 +8819,26 @@ diff -Nur linux-4.0.4.orig/fs/aufs/export.c linux-4.0.4/fs/aufs/export.c + BUILD_BUG_ON(sizeof(u) != sizeof(int)); + atomic_set(&sbinfo->si_xigen_next, u); +} -diff -Nur linux-4.0.4.orig/fs/aufs/fhsm.c linux-4.0.4/fs/aufs/fhsm.c ---- linux-4.0.4.orig/fs/aufs/fhsm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/fhsm.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,412 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/fhsm.c linux-4.0.5/fs/aufs/fhsm.c +--- linux-4.0.5.orig/fs/aufs/fhsm.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/fhsm.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,426 @@ +/* + * Copyright (C) 2011-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* @@ -10493,12 +9249,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/fhsm.c linux-4.0.4/fs/aufs/fhsm.c + if (u != AUFS_FHSM_CACHE_DEF_SEC) + seq_printf(seq, ",fhsm_sec=%u", u); +} -diff -Nur linux-4.0.4.orig/fs/aufs/file.c linux-4.0.4/fs/aufs/file.c ---- linux-4.0.4.orig/fs/aufs/file.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/file.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,831 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/file.c linux-4.0.5/fs/aufs/file.c +--- linux-4.0.5.orig/fs/aufs/file.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/file.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,844 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -11328,12 +10097,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/file.c linux-4.0.4/fs/aufs/file.c + .swap_deactivate = aufs_swap_deactivate +#endif /* CONFIG_AUFS_DEBUG */ +}; -diff -Nur linux-4.0.4.orig/fs/aufs/file.h linux-4.0.4/fs/aufs/file.h ---- linux-4.0.4.orig/fs/aufs/file.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/file.h 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,277 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/file.h linux-4.0.5/fs/aufs/file.h +--- linux-4.0.5.orig/fs/aufs/file.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/file.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,291 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -11432,6 +10214,7 @@ diff -Nur linux-4.0.4.orig/fs/aufs/file.h linux-4.0.4/fs/aufs/file.h +extern const struct file_operations aufs_file_fop; +int au_do_open_nondir(struct file *file, int flags, struct file *h_file); +int aufs_release_nondir(struct inode *inode __maybe_unused, struct file *file); ++struct file *au_read_pre(struct file *file, int keep_fi); + +/* finfo.c */ +void au_hfput(struct au_hfile *hf, struct file *file); @@ -11609,12 +10392,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/file.h linux-4.0.4/fs/aufs/file.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_FILE_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/finfo.c linux-4.0.4/fs/aufs/finfo.c ---- linux-4.0.4.orig/fs/aufs/finfo.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/finfo.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,144 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/finfo.c linux-4.0.5/fs/aufs/finfo.c +--- linux-4.0.5.orig/fs/aufs/finfo.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/finfo.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,157 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -11757,12 +10553,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/finfo.c linux-4.0.4/fs/aufs/finfo.c +out: + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c ---- linux-4.0.4.orig/fs/aufs/f_op.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/f_op.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,807 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/f_op.c linux-4.0.5/fs/aufs/f_op.c +--- linux-4.0.5.orig/fs/aufs/f_op.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/f_op.c 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,748 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -11879,33 +10688,122 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c + * read functions after [fdi]_rwsem are released, but it should be harmless. + */ + -+static ssize_t aufs_read(struct file *file, char __user *buf, size_t count, -+ loff_t *ppos) ++/* Callers should call au_read_post() or fput() in the end */ ++struct file *au_read_pre(struct file *file, int keep_fi) +{ -+ ssize_t err; -+ struct dentry *dentry; + struct file *h_file; -+ struct super_block *sb; ++ int err; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); ++ if (!err) { ++ di_read_unlock(file->f_path.dentry, AuLock_IR); ++ h_file = au_hf_top(file); ++ get_file(h_file); ++ if (!keep_fi) ++ fi_read_unlock(file); ++ } else ++ h_file = ERR_PTR(err); ++ ++ return h_file; ++} ++ ++static void au_read_post(struct inode *inode, struct file *h_file) ++{ ++ /* update without lock, I don't think it a problem */ ++ fsstack_copy_attr_atime(inode, file_inode(h_file)); ++ fput(h_file); ++} ++ ++struct au_write_pre { ++ blkcnt_t blks; ++ aufs_bindex_t bstart; ++}; ++ ++/* ++ * return with iinfo is write-locked ++ * callers should call au_write_post() or iinfo_write_unlock() + fput() in the ++ * end ++ */ ++static struct file *au_write_pre(struct file *file, int do_ready, ++ struct au_write_pre *wpre) ++{ ++ struct file *h_file; ++ struct dentry *dentry; ++ int err; ++ struct au_pin pin; ++ ++ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); ++ h_file = ERR_PTR(err); + if (unlikely(err)) + goto out; + ++ dentry = file->f_path.dentry; ++ if (do_ready) { ++ err = au_ready_to_write(file, -1, &pin); ++ if (unlikely(err)) { ++ h_file = ERR_PTR(err); ++ di_write_unlock(dentry); ++ goto out_fi; ++ } ++ } ++ ++ di_downgrade_lock(dentry, /*flags*/0); ++ if (wpre) ++ wpre->bstart = au_fbstart(file); + h_file = au_hf_top(file); + get_file(h_file); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_read_unlock(file); ++ if (wpre) ++ wpre->blks = file_inode(h_file)->i_blocks; ++ if (do_ready) ++ au_unpin(&pin); ++ di_read_unlock(dentry, /*flags*/0); ++ ++out_fi: ++ fi_write_unlock(file); ++out: ++ return h_file; ++} ++ ++static void au_write_post(struct inode *inode, struct file *h_file, ++ struct au_write_pre *wpre, ssize_t written) ++{ ++ struct inode *h_inode; ++ ++ au_cpup_attr_timesizes(inode); ++ AuDebugOn(au_ibstart(inode) != wpre->bstart); ++ h_inode = file_inode(h_file); ++ inode->i_mode = h_inode->i_mode; ++ ii_write_unlock(inode); ++ fput(h_file); ++ ++ /* AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); */ ++ if (written > 0) ++ au_fhsm_wrote(inode->i_sb, wpre->bstart, ++ /*force*/h_inode->i_blocks > wpre->blks); ++} ++ ++static ssize_t aufs_read(struct file *file, char __user *buf, size_t count, ++ loff_t *ppos) ++{ ++ ssize_t err; ++ struct inode *inode; ++ struct file *h_file; ++ struct super_block *sb; ++ ++ inode = file_inode(file); ++ sb = inode->i_sb; ++ si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); ++ ++ h_file = au_read_pre(file, /*keep_fi*/0); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) ++ goto out; + + /* filedata may be obsoleted by concurrent copyup, but no problem */ + err = vfsub_read_u(h_file, buf, count, ppos); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ -+ /* update without lock, I don't think it a problem */ -+ fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); -+ fput(h_file); ++ au_read_post(inode, h_file); + +out: + si_read_unlock(sb); @@ -11938,53 +10836,24 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c + size_t count, loff_t *ppos) +{ + ssize_t err; -+ blkcnt_t blks; -+ aufs_bindex_t bstart; -+ struct au_pin pin; -+ struct dentry *dentry; -+ struct inode *inode, *h_inode; -+ struct super_block *sb; ++ struct au_write_pre wpre; ++ struct inode *inode; + struct file *h_file; + char __user *buf = (char __user *)ubuf; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = file_inode(file); + au_mtx_and_read_lock(inode); + -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out; -+ -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) { -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; -+ } -+ -+ bstart = au_fbstart(file); -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ h_inode = file_inode(h_file); -+ blks = h_inode->i_blocks; -+ au_unpin(&pin); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); + + err = vfsub_write_u(h_file, buf, count, ppos); -+ ii_write_lock_child(inode); -+ au_cpup_attr_timesizes(inode); -+ inode->i_mode = file_inode(h_file)->i_mode; -+ AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); -+ if (err > 0) -+ au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); -+ ii_write_unlock(inode); -+ fput(h_file); ++ au_write_post(inode, h_file, &wpre, err); + +out: -+ si_read_unlock(sb); ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); + return err; +} @@ -12036,28 +10905,23 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c +{ + ssize_t err; + struct file *file, *h_file; -+ struct dentry *dentry; ++ struct inode *inode; + struct super_block *sb; + + file = kio->ki_filp; -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ inode = file_inode(file); ++ sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) -+ goto out; + -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_read_unlock(file); ++ h_file = au_read_pre(file, /*keep_fi*/0); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) ++ goto out; + + err = au_do_iter(h_file, MAY_READ, kio, iov_iter); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ -+ /* update without lock, I don't think it a problem */ -+ fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); -+ fput(h_file); ++ au_read_post(inode, h_file); + +out: + si_read_unlock(sb); @@ -12067,53 +10931,24 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c +static ssize_t aufs_write_iter(struct kiocb *kio, struct iov_iter *iov_iter) +{ + ssize_t err; -+ blkcnt_t blks; -+ aufs_bindex_t bstart; -+ struct au_pin pin; -+ struct dentry *dentry; -+ struct inode *inode, *h_inode; ++ struct au_write_pre wpre; ++ struct inode *inode; + struct file *file, *h_file; -+ struct super_block *sb; + + file = kio->ki_filp; -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = file_inode(file); + au_mtx_and_read_lock(inode); + -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out; -+ -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) { -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; -+ } -+ -+ bstart = au_fbstart(file); -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ h_inode = file_inode(h_file); -+ blks = h_inode->i_blocks; -+ au_unpin(&pin); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); + + err = au_do_iter(h_file, MAY_WRITE, kio, iov_iter); -+ ii_write_lock_child(inode); -+ au_cpup_attr_timesizes(inode); -+ inode->i_mode = file_inode(h_file)->i_mode; -+ AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); -+ if (err > 0) -+ au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); -+ ii_write_unlock(inode); -+ fput(h_file); ++ au_write_post(inode, h_file, &wpre, err); + +out: -+ si_read_unlock(sb); ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); + return err; +} @@ -12124,19 +10959,18 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c +{ + ssize_t err; + struct file *h_file; -+ struct dentry *dentry; ++ struct inode *inode; + struct super_block *sb; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ inode = file_inode(file); ++ sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) ++ ++ h_file = au_read_pre(file, /*keep_fi*/1); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ err = -EINVAL; -+ h_file = au_hf_top(file); -+ get_file(h_file); + if (au_test_loopback_kthread()) { + au_warn_loopback(h_file->f_path.dentry->d_sb); + if (file->f_mapping != h_file->f_mapping) { @@ -12144,15 +10978,12 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c + smp_mb(); /* unnecessary? */ + } + } -+ di_read_unlock(dentry, AuLock_IR); + fi_read_unlock(file); + + err = vfsub_splice_to(h_file, ppos, pipe, len, flags); + /* todo: necessasry? */ + /* file->f_ra = h_file->f_ra; */ -+ /* update without lock, I don't think it a problem */ -+ fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); -+ fput(h_file); ++ au_read_post(inode, h_file); + +out: + si_read_unlock(sb); @@ -12164,52 +10995,23 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c + size_t len, unsigned int flags) +{ + ssize_t err; -+ blkcnt_t blks; -+ aufs_bindex_t bstart; -+ struct au_pin pin; -+ struct dentry *dentry; -+ struct inode *inode, *h_inode; -+ struct super_block *sb; ++ struct au_write_pre wpre; ++ struct inode *inode; + struct file *h_file; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = file_inode(file); + au_mtx_and_read_lock(inode); + -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out; -+ -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) { -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; -+ } -+ -+ bstart = au_fbstart(file); -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ h_inode = file_inode(h_file); -+ blks = h_inode->i_blocks; -+ au_unpin(&pin); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); + + err = vfsub_splice_from(pipe, h_file, ppos, len, flags); -+ ii_write_lock_child(inode); -+ au_cpup_attr_timesizes(inode); -+ inode->i_mode = file_inode(h_file)->i_mode; -+ AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); -+ if (err > 0) -+ au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); -+ ii_write_unlock(inode); -+ fput(h_file); ++ au_write_post(inode, h_file, &wpre, err); + +out: -+ si_read_unlock(sb); ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); + return err; +} @@ -12218,46 +11020,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c + loff_t len) +{ + long err; -+ struct au_pin pin; -+ struct dentry *dentry; -+ struct super_block *sb; ++ struct au_write_pre wpre; + struct inode *inode; + struct file *h_file; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = file_inode(file); + au_mtx_and_read_lock(inode); + -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out; -+ -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) { -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; -+ } -+ -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ au_unpin(&pin); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); + + lockdep_off(); + err = vfs_fallocate(h_file, mode, offset, len); + lockdep_on(); -+ ii_write_lock_child(inode); -+ au_cpup_attr_timesizes(inode); -+ inode->i_mode = file_inode(h_file)->i_mode; -+ ii_write_unlock(inode); -+ fput(h_file); ++ au_write_post(inode, h_file, &wpre, /*written*/1); + +out: -+ si_read_unlock(sb); ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); + return err; +} @@ -12322,44 +11103,27 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c +static int aufs_mmap(struct file *file, struct vm_area_struct *vma) +{ + int err; -+ aufs_bindex_t bstart; + const unsigned char wlock + = (file->f_mode & FMODE_WRITE) && (vma->vm_flags & VM_SHARED); -+ struct dentry *dentry; + struct super_block *sb; + struct file *h_file; -+ struct au_branch *br; -+ struct au_pin pin; ++ struct inode *inode; + + AuDbgVmRegion(file, vma); + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ inode = file_inode(file); ++ sb = inode->i_sb; + lockdep_off(); + si_read_lock(sb, AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out; -+ -+ if (wlock) { -+ err = au_ready_to_write(file, -1, &pin); -+ di_write_unlock(dentry); -+ if (unlikely(err)) { -+ fi_write_unlock(file); -+ goto out; -+ } -+ au_unpin(&pin); -+ } else -+ di_write_unlock(dentry); + -+ bstart = au_fbstart(file); -+ br = au_sbr(sb, bstart); -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ au_set_mmapped(file); -+ fi_write_unlock(file); ++ h_file = au_write_pre(file, wlock, /*wpre*/NULL); + lockdep_on(); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) ++ goto out; + ++ err = 0; ++ au_set_mmapped(file); + au_vm_file_reset(vma, h_file); + /* + * we cannot call security_mmap_file() here since it may acquire @@ -12370,21 +11134,21 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c + */ + if (!err) + err = h_file->f_op->mmap(h_file, vma); -+ if (unlikely(err)) -+ goto out_reset; -+ -+ au_vm_prfile_set(vma, file); -+ /* update without lock, I don't think it a problem */ -+ fsstack_copy_attr_atime(file_inode(file), file_inode(h_file)); -+ goto out_fput; /* success */ -+ -+out_reset: ++ if (!err) { ++ au_vm_prfile_set(vma, file); ++ fsstack_copy_attr_atime(inode, file_inode(h_file)); ++ goto out_fput; /* success */ ++ } + au_unset_mmapped(file); + au_vm_file_reset(vma, file); ++ +out_fput: -+ fput(h_file); + lockdep_off(); ++ ii_write_unlock(inode); ++ lockdep_on(); ++ fput(h_file); +out: ++ lockdep_off(); + si_read_unlock(sb); + lockdep_on(); + AuTraceErr(err); @@ -12397,45 +11161,29 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c + int datasync) +{ + int err; -+ struct au_pin pin; -+ struct dentry *dentry; ++ struct au_write_pre wpre; + struct inode *inode; + struct file *h_file; -+ struct super_block *sb; -+ -+ dentry = file->f_path.dentry; -+ inode = dentry->d_inode; -+ sb = dentry->d_sb; -+ mutex_lock(&inode->i_mutex); -+ err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); -+ if (unlikely(err)) -+ goto out; + + err = 0; /* -EBADF; */ /* posix? */ + if (unlikely(!(file->f_mode & FMODE_WRITE))) -+ goto out_si; -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out_si; ++ goto out; + -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) ++ inode = file_inode(file); ++ au_mtx_and_read_lock(inode); ++ ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out_unlock; -+ au_unpin(&pin); + -+ err = -EINVAL; -+ h_file = au_hf_top(file); + err = vfsub_fsync(h_file, &h_file->f_path, datasync); -+ au_cpup_attr_timesizes(inode); ++ au_write_post(inode, h_file, &wpre, /*written*/0); + +out_unlock: -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+out_si: -+ si_read_unlock(sb); -+out: ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); ++out: + return err; +} + @@ -12444,28 +11192,22 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c +static int aufs_aio_fsync_nondir(struct kiocb *kio, int datasync) +{ + int err; -+ struct au_pin pin; -+ struct dentry *dentry; ++ struct au_write_pre wpre; + struct inode *inode; + struct file *file, *h_file; + -+ file = kio->ki_filp; -+ dentry = file->f_path.dentry; -+ inode = dentry->d_inode; -+ au_mtx_and_read_lock(inode); -+ + err = 0; /* -EBADF; */ /* posix? */ + if (unlikely(!(file->f_mode & FMODE_WRITE))) + goto out; -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out; + -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) ++ file = kio->ki_filp; ++ inode = file_inode(file); ++ au_mtx_and_read_lock(inode); ++ ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out_unlock; -+ au_unpin(&pin); + + err = -ENOSYS; + h_file = au_hf_top(file); @@ -12483,16 +11225,14 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c + if (!err) + vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL); + /*ignore*/ -+ au_cpup_attr_timesizes(inode); + mutex_unlock(h_mtx); + } ++ au_write_post(inode, h_file, &wpre, /*written*/0); + +out_unlock: -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+out: + si_read_unlock(inode->sb); + mutex_unlock(&inode->i_mutex); ++out: + return err; +} +#endif @@ -12501,22 +11241,19 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c +{ + int err; + struct file *h_file; -+ struct dentry *dentry; + struct super_block *sb; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ sb = file->f_path.dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) ++ ++ h_file = au_read_pre(file, /*keep_fi*/0); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ h_file = au_hf_top(file); + if (h_file->f_op->fasync) + err = h_file->f_op->fasync(fd, h_file, flag); -+ -+ di_read_unlock(dentry, AuLock_IR); -+ fi_read_unlock(file); ++ fput(h_file); /* instead of au_read_post() */ + +out: + si_read_unlock(sb); @@ -12568,12 +11305,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/f_op.c linux-4.0.4/fs/aufs/f_op.c +#endif + .fallocate = aufs_fallocate +}; -diff -Nur linux-4.0.4.orig/fs/aufs/fstype.h linux-4.0.4/fs/aufs/fstype.h ---- linux-4.0.4.orig/fs/aufs/fstype.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/fstype.h 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,387 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/fstype.h linux-4.0.5/fs/aufs/fstype.h +--- linux-4.0.5.orig/fs/aufs/fstype.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/fstype.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,400 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -12959,12 +11709,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/fstype.h linux-4.0.4/fs/aufs/fstype.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_FSTYPE_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/hfsnotify.c linux-4.0.4/fs/aufs/hfsnotify.c ---- linux-4.0.4.orig/fs/aufs/hfsnotify.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/hfsnotify.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,275 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/hfsnotify.c linux-4.0.5/fs/aufs/hfsnotify.c +--- linux-4.0.5.orig/fs/aufs/hfsnotify.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/hfsnotify.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,288 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -13238,12 +12001,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/hfsnotify.c linux-4.0.4/fs/aufs/hfsnotify.c + .fin_br = au_hfsn_fin_br, + .init_br = au_hfsn_init_br +}; -diff -Nur linux-4.0.4.orig/fs/aufs/hfsplus.c linux-4.0.4/fs/aufs/hfsplus.c ---- linux-4.0.4.orig/fs/aufs/hfsplus.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/hfsplus.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,43 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/hfsplus.c linux-4.0.5/fs/aufs/hfsplus.c +--- linux-4.0.5.orig/fs/aufs/hfsplus.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/hfsplus.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,56 @@ +/* + * Copyright (C) 2010-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -13285,12 +12061,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/hfsplus.c linux-4.0.4/fs/aufs/hfsplus.c + au_sbr_put(dentry->d_sb, bindex); + } +} -diff -Nur linux-4.0.4.orig/fs/aufs/hnotify.c linux-4.0.4/fs/aufs/hnotify.c ---- linux-4.0.4.orig/fs/aufs/hnotify.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/hnotify.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,701 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/hnotify.c linux-4.0.5/fs/aufs/hnotify.c +--- linux-4.0.5.orig/fs/aufs/hnotify.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/hnotify.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,714 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -13990,12 +12779,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/hnotify.c linux-4.0.4/fs/aufs/hnotify.c + if (au_cachep[AuCache_HNOTIFY]) + au_hn_destroy_cache(); +} -diff -Nur linux-4.0.4.orig/fs/aufs/iinfo.c linux-4.0.4/fs/aufs/iinfo.c ---- linux-4.0.4.orig/fs/aufs/iinfo.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/iinfo.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,264 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/iinfo.c linux-4.0.5/fs/aufs/iinfo.c +--- linux-4.0.5.orig/fs/aufs/iinfo.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/iinfo.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,277 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -14258,12 +13060,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/iinfo.c linux-4.0.4/fs/aufs/iinfo.c + iinfo->ii_hinode = NULL; + AuRwDestroy(&iinfo->ii_rwsem); +} -diff -Nur linux-4.0.4.orig/fs/aufs/inode.c linux-4.0.4/fs/aufs/inode.c ---- linux-4.0.4.orig/fs/aufs/inode.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/inode.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,482 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/inode.c linux-4.0.5/fs/aufs/inode.c +--- linux-4.0.5.orig/fs/aufs/inode.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/inode.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,495 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -14744,12 +13559,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/inode.c linux-4.0.4/fs/aufs/inode.c + mask |= MAY_READ; /* force permission check */ + return au_test_h_perm(h_inode, mask); +} -diff -Nur linux-4.0.4.orig/fs/aufs/inode.h linux-4.0.4/fs/aufs/inode.h ---- linux-4.0.4.orig/fs/aufs/inode.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/inode.h 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,660 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/inode.h linux-4.0.5/fs/aufs/inode.h +--- linux-4.0.5.orig/fs/aufs/inode.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/inode.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,673 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -15408,12 +14236,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/inode.h linux-4.0.4/fs/aufs/inode.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_INODE_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/ioctl.c linux-4.0.4/fs/aufs/ioctl.c ---- linux-4.0.4.orig/fs/aufs/ioctl.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/ioctl.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,206 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/ioctl.c linux-4.0.5/fs/aufs/ioctl.c +--- linux-4.0.5.orig/fs/aufs/ioctl.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/ioctl.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,219 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -15618,12 +14459,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/ioctl.c linux-4.0.4/fs/aufs/ioctl.c + return aufs_ioctl_nondir(file, cmd, (unsigned long)compat_ptr(arg)); +} +#endif -diff -Nur linux-4.0.4.orig/fs/aufs/i_op_add.c linux-4.0.4/fs/aufs/i_op_add.c ---- linux-4.0.4.orig/fs/aufs/i_op_add.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/i_op_add.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,917 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/i_op_add.c linux-4.0.5/fs/aufs/i_op_add.c +--- linux-4.0.5.orig/fs/aufs/i_op_add.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/i_op_add.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,930 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -16539,12 +15393,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/i_op_add.c linux-4.0.4/fs/aufs/i_op_add.c +out: + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/i_op.c linux-4.0.4/fs/aufs/i_op.c ---- linux-4.0.4.orig/fs/aufs/i_op.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/i_op.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,1432 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/i_op.c linux-4.0.5/fs/aufs/i_op.c +--- linux-4.0.5.orig/fs/aufs/i_op.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/i_op.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,1445 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -17975,12 +16842,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/i_op.c linux-4.0.4/fs/aufs/i_op.c + + .update_time = aufs_update_time +}; -diff -Nur linux-4.0.4.orig/fs/aufs/i_op_del.c linux-4.0.4/fs/aufs/i_op_del.c ---- linux-4.0.4.orig/fs/aufs/i_op_del.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/i_op_del.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,493 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/i_op_del.c linux-4.0.5/fs/aufs/i_op_del.c +--- linux-4.0.5.orig/fs/aufs/i_op_del.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/i_op_del.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,506 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -18472,12 +17352,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/i_op_del.c linux-4.0.4/fs/aufs/i_op_del.c + AuTraceErr(err); + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/i_op_ren.c linux-4.0.4/fs/aufs/i_op_ren.c ---- linux-4.0.4.orig/fs/aufs/i_op_ren.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/i_op_ren.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,1002 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/i_op_ren.c linux-4.0.5/fs/aufs/i_op_ren.c +--- linux-4.0.5.orig/fs/aufs/i_op_ren.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/i_op_ren.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,1015 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -19478,12 +18371,12 @@ diff -Nur linux-4.0.4.orig/fs/aufs/i_op_ren.c linux-4.0.4/fs/aufs/i_op_ren.c + AuTraceErr(err); + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/Kconfig linux-4.0.4/fs/aufs/Kconfig ---- linux-4.0.4.orig/fs/aufs/Kconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/Kconfig 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/aufs/Kconfig linux-4.0.5/fs/aufs/Kconfig +--- linux-4.0.5.orig/fs/aufs/Kconfig 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/Kconfig 2015-06-21 14:07:48.682432781 -0500 @@ -0,0 +1,185 @@ +config AUFS_FS -+ bool "Aufs (Advanced multi layered unification filesystem) support" ++ tristate "Aufs (Advanced multi layered unification filesystem) support" + help + Aufs is a stackable unification filesystem such as Unionfs, + which unifies several directories and provides a merged single @@ -19555,7 +18448,7 @@ diff -Nur linux-4.0.4.orig/fs/aufs/Kconfig linux-4.0.4/fs/aufs/Kconfig + +config AUFS_EXPORT + bool "NFS-exportable aufs" -+ depends on EXPORTFS = y ++ depends on EXPORTFS + help + If you want to export your mounted aufs via NFS, then enable this + option. There are several requirements for this configuration. @@ -19667,12 +18560,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/Kconfig linux-4.0.4/fs/aufs/Kconfig + Automatic configuration for internal use. + When aufs supports Magic SysRq, enabled automatically. +endif -diff -Nur linux-4.0.4.orig/fs/aufs/loop.c linux-4.0.4/fs/aufs/loop.c ---- linux-4.0.4.orig/fs/aufs/loop.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/loop.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,132 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/loop.c linux-4.0.5/fs/aufs/loop.c +--- linux-4.0.5.orig/fs/aufs/loop.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/loop.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,145 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -19803,12 +18709,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/loop.c linux-4.0.4/fs/aufs/loop.c + symbol_put(loop_backing_file); + kfree(au_warn_loopback_array); +} -diff -Nur linux-4.0.4.orig/fs/aufs/loop.h linux-4.0.4/fs/aufs/loop.h ---- linux-4.0.4.orig/fs/aufs/loop.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/loop.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,39 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/loop.h linux-4.0.5/fs/aufs/loop.h +--- linux-4.0.5.orig/fs/aufs/loop.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/loop.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,52 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -19846,9 +18765,9 @@ diff -Nur linux-4.0.4.orig/fs/aufs/loop.h linux-4.0.4/fs/aufs/loop.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_LOOP_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/magic.mk linux-4.0.4/fs/aufs/magic.mk ---- linux-4.0.4.orig/fs/aufs/magic.mk 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/magic.mk 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/aufs/magic.mk linux-4.0.5/fs/aufs/magic.mk +--- linux-4.0.5.orig/fs/aufs/magic.mk 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/magic.mk 2015-06-21 14:07:48.686432781 -0500 @@ -0,0 +1,30 @@ + +# defined in ${srctree}/fs/fuse/inode.c @@ -19880,18 +18799,26 @@ diff -Nur linux-4.0.4.orig/fs/aufs/magic.mk linux-4.0.4/fs/aufs/magic.mk +ifdef CONFIG_HFSPLUS_FS +ccflags-y += -DHFSPLUS_SUPER_MAGIC=0x482b +endif -diff -Nur linux-4.0.4.orig/fs/aufs/Makefile linux-4.0.4/fs/aufs/Makefile ---- linux-4.0.4.orig/fs/aufs/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/Makefile 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,36 @@ -+ -+include ${srctree}/${src}/magic.mk +diff -Nur linux-4.0.5.orig/fs/aufs/Makefile linux-4.0.5/fs/aufs/Makefile +--- linux-4.0.5.orig/fs/aufs/Makefile 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/Makefile 2015-06-21 14:07:48.682432781 -0500 +@@ -0,0 +1,44 @@ ++ ++include ${src}/magic.mk ++ifeq (${CONFIG_AUFS_FS},m) ++include ${src}/conf.mk ++endif ++-include ${src}/priv_def.mk + +# cf. include/linux/kernel.h +# enable pr_debug +ccflags-y += -DDEBUG +# sparse requires the full pathname ++ifdef M ++ccflags-y += -include ${M}/../../include/uapi/linux/aufs_type.h ++else +ccflags-y += -include ${srctree}/include/uapi/linux/aufs_type.h ++endif + +obj-$(CONFIG_AUFS_FS) += aufs.o +aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \ @@ -19920,12 +18847,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/Makefile linux-4.0.4/fs/aufs/Makefile +aufs-$(CONFIG_AUFS_BR_HFSPLUS) += hfsplus.o +aufs-$(CONFIG_AUFS_DEBUG) += debug.o +aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o -diff -Nur linux-4.0.4.orig/fs/aufs/module.c linux-4.0.4/fs/aufs/module.c ---- linux-4.0.4.orig/fs/aufs/module.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/module.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,196 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/module.c linux-4.0.5/fs/aufs/module.c +--- linux-4.0.5.orig/fs/aufs/module.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/module.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,210 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -20015,6 +18955,7 @@ diff -Nur linux-4.0.4.orig/fs/aufs/module.c linux-4.0.4/fs/aufs/module.c +MODULE_DESCRIPTION(AUFS_NAME + " -- Advanced multi layered unification filesystem"); +MODULE_VERSION(AUFS_VERSION); ++MODULE_ALIAS_FS(AUFS_NAME); + +/* this module parameter has no meaning when SYSFS is disabled */ +int sysaufs_brs = 1; @@ -20120,12 +19061,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/module.c linux-4.0.4/fs/aufs/module.c + +module_init(aufs_init); +module_exit(aufs_exit); -diff -Nur linux-4.0.4.orig/fs/aufs/module.h linux-4.0.4/fs/aufs/module.h ---- linux-4.0.4.orig/fs/aufs/module.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/module.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,91 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/module.h linux-4.0.5/fs/aufs/module.h +--- linux-4.0.5.orig/fs/aufs/module.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/module.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,104 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -20215,12 +19169,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/module.h linux-4.0.4/fs/aufs/module.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_MODULE_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/mvdown.c linux-4.0.4/fs/aufs/mvdown.c ---- linux-4.0.4.orig/fs/aufs/mvdown.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/mvdown.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,681 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/mvdown.c linux-4.0.5/fs/aufs/mvdown.c +--- linux-4.0.5.orig/fs/aufs/mvdown.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/mvdown.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,694 @@ +/* + * Copyright (C) 2011-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -20900,12 +19867,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/mvdown.c linux-4.0.4/fs/aufs/mvdown.c + AuTraceErr(err); + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/opts.c linux-4.0.4/fs/aufs/opts.c ---- linux-4.0.4.orig/fs/aufs/opts.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/opts.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,1822 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/opts.c linux-4.0.5/fs/aufs/opts.c +--- linux-4.0.5.orig/fs/aufs/opts.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/opts.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,1835 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -22726,12 +21706,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/opts.c linux-4.0.4/fs/aufs/opts.c +{ + return au_mntflags(sb) & AuOptMask_UDBA; +} -diff -Nur linux-4.0.4.orig/fs/aufs/opts.h linux-4.0.4/fs/aufs/opts.h ---- linux-4.0.4.orig/fs/aufs/opts.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/opts.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,197 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/opts.h linux-4.0.5/fs/aufs/opts.h +--- linux-4.0.5.orig/fs/aufs/opts.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/opts.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,210 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -22927,12 +21920,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/opts.h linux-4.0.4/fs/aufs/opts.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_OPTS_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/plink.c linux-4.0.4/fs/aufs/plink.c ---- linux-4.0.4.orig/fs/aufs/plink.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/plink.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,519 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/plink.c linux-4.0.5/fs/aufs/plink.c +--- linux-4.0.5.orig/fs/aufs/plink.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/plink.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,532 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -23450,12 +22456,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/plink.c linux-4.0.4/fs/aufs/plink.c + } + } +} -diff -Nur linux-4.0.4.orig/fs/aufs/poll.c linux-4.0.4/fs/aufs/poll.c ---- linux-4.0.4.orig/fs/aufs/poll.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/poll.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,42 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/poll.c linux-4.0.5/fs/aufs/poll.c +--- linux-4.0.5.orig/fs/aufs/poll.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/poll.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,52 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -23470,38 +22489,48 @@ diff -Nur linux-4.0.4.orig/fs/aufs/poll.c linux-4.0.4/fs/aufs/poll.c + unsigned int mask; + int err; + struct file *h_file; -+ struct dentry *dentry; + struct super_block *sb; + + /* We should pretend an error happened. */ + mask = POLLERR /* | POLLIN | POLLOUT */; -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ sb = file->f_path.dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) ++ ++ h_file = au_read_pre(file, /*keep_fi*/0); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + + /* it is not an error if h_file has no operation */ + mask = DEFAULT_POLLMASK; -+ h_file = au_hf_top(file); + if (h_file->f_op->poll) + mask = h_file->f_op->poll(h_file, wait); -+ -+ di_read_unlock(dentry, AuLock_IR); -+ fi_read_unlock(file); ++ fput(h_file); /* instead of au_read_post() */ + +out: + si_read_unlock(sb); + AuTraceErr((int)mask); + return mask; +} -diff -Nur linux-4.0.4.orig/fs/aufs/posix_acl.c linux-4.0.4/fs/aufs/posix_acl.c ---- linux-4.0.4.orig/fs/aufs/posix_acl.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/posix_acl.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,86 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/posix_acl.c linux-4.0.5/fs/aufs/posix_acl.c +--- linux-4.0.5.orig/fs/aufs/posix_acl.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/posix_acl.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,99 @@ +/* + * Copyright (C) 2014-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -23586,12 +22615,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/posix_acl.c linux-4.0.4/fs/aufs/posix_acl.c + mutex_unlock(&inode->i_mutex); + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/procfs.c linux-4.0.4/fs/aufs/procfs.c ---- linux-4.0.4.orig/fs/aufs/procfs.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/procfs.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,156 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/procfs.c linux-4.0.5/fs/aufs/procfs.c +--- linux-4.0.5.orig/fs/aufs/procfs.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/procfs.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,169 @@ +/* + * Copyright (C) 2010-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -23746,12 +22788,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/procfs.c linux-4.0.4/fs/aufs/procfs.c +out: + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/rdu.c linux-4.0.4/fs/aufs/rdu.c ---- linux-4.0.4.orig/fs/aufs/rdu.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/rdu.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,375 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/rdu.c linux-4.0.5/fs/aufs/rdu.c +--- linux-4.0.5.orig/fs/aufs/rdu.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/rdu.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,388 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -24125,12 +23180,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/rdu.c linux-4.0.4/fs/aufs/rdu.c + return err; +} +#endif -diff -Nur linux-4.0.4.orig/fs/aufs/rwsem.h linux-4.0.4/fs/aufs/rwsem.h ---- linux-4.0.4.orig/fs/aufs/rwsem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/rwsem.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,178 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/rwsem.h linux-4.0.5/fs/aufs/rwsem.h +--- linux-4.0.5.orig/fs/aufs/rwsem.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/rwsem.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,191 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -24307,12 +23375,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/rwsem.h linux-4.0.4/fs/aufs/rwsem.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_RWSEM_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/sbinfo.c linux-4.0.4/fs/aufs/sbinfo.c ---- linux-4.0.4.orig/fs/aufs/sbinfo.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/sbinfo.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,341 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/sbinfo.c linux-4.0.5/fs/aufs/sbinfo.c +--- linux-4.0.5.orig/fs/aufs/sbinfo.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/sbinfo.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,354 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -24652,12 +23733,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/sbinfo.c linux-4.0.4/fs/aufs/sbinfo.c + p = radix_tree_delete(&sbinfo->au_si_pid.tree, current->pid); + spin_unlock(&sbinfo->au_si_pid.tree_lock); +} -diff -Nur linux-4.0.4.orig/fs/aufs/spl.h linux-4.0.4/fs/aufs/spl.h ---- linux-4.0.4.orig/fs/aufs/spl.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/spl.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,98 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/spl.h linux-4.0.5/fs/aufs/spl.h +--- linux-4.0.5.orig/fs/aufs/spl.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/spl.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,111 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -24754,12 +23848,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/spl.h linux-4.0.4/fs/aufs/spl.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_SPL_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/super.c linux-4.0.4/fs/aufs/super.c ---- linux-4.0.4.orig/fs/aufs/super.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/super.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,993 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/super.c linux-4.0.5/fs/aufs/super.c +--- linux-4.0.5.orig/fs/aufs/super.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/super.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,1006 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -25751,12 +24858,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/super.c linux-4.0.4/fs/aufs/super.c + /* no need to __module_get() and module_put(). */ + .owner = THIS_MODULE, +}; -diff -Nur linux-4.0.4.orig/fs/aufs/super.h linux-4.0.4/fs/aufs/super.h ---- linux-4.0.4.orig/fs/aufs/super.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/super.h 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,626 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/super.h linux-4.0.5/fs/aufs/super.h +--- linux-4.0.5.orig/fs/aufs/super.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/super.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,639 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -26381,12 +25501,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/super.h linux-4.0.4/fs/aufs/super.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_SUPER_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/sysaufs.c linux-4.0.4/fs/aufs/sysaufs.c ---- linux-4.0.4.orig/fs/aufs/sysaufs.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/sysaufs.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,91 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/sysaufs.c linux-4.0.5/fs/aufs/sysaufs.c +--- linux-4.0.5.orig/fs/aufs/sysaufs.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/sysaufs.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,104 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -26476,12 +25609,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/sysaufs.c linux-4.0.4/fs/aufs/sysaufs.c +out: + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/sysaufs.h linux-4.0.4/fs/aufs/sysaufs.h ---- linux-4.0.4.orig/fs/aufs/sysaufs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/sysaufs.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,88 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/sysaufs.h linux-4.0.5/fs/aufs/sysaufs.h +--- linux-4.0.5.orig/fs/aufs/sysaufs.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/sysaufs.h 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,101 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -26568,12 +25714,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/sysaufs.h linux-4.0.4/fs/aufs/sysaufs.h + +#endif /* __KERNEL__ */ +#endif /* __SYSAUFS_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/sysfs.c linux-4.0.4/fs/aufs/sysfs.c ---- linux-4.0.4.orig/fs/aufs/sysfs.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/sysfs.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,336 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/sysfs.c linux-4.0.5/fs/aufs/sysfs.c +--- linux-4.0.5.orig/fs/aufs/sysfs.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/sysfs.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,372 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -26584,7 +25743,30 @@ diff -Nur linux-4.0.4.orig/fs/aufs/sysfs.c linux-4.0.4/fs/aufs/sysfs.c +#include +#include "aufs.h" + ++#ifdef CONFIG_AUFS_FS_MODULE ++/* this entry violates the "one line per file" policy of sysfs */ ++static ssize_t config_show(struct kobject *kobj, struct kobj_attribute *attr, ++ char *buf) ++{ ++ ssize_t err; ++ static char *conf = ++/* this file is generated at compiling */ ++#include "conf.str" ++ ; ++ ++ err = snprintf(buf, PAGE_SIZE, conf); ++ if (unlikely(err >= PAGE_SIZE)) ++ err = -EFBIG; ++ return err; ++} ++ ++static struct kobj_attribute au_config_attr = __ATTR_RO(config); ++#endif ++ +static struct attribute *au_attr[] = { ++#ifdef CONFIG_AUFS_FS_MODULE ++ &au_config_attr.attr, ++#endif + NULL, /* need to NULL terminate the list of attributes */ +}; + @@ -26908,12 +26090,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/sysfs.c linux-4.0.4/fs/aufs/sysfs.c + } + } +} -diff -Nur linux-4.0.4.orig/fs/aufs/sysrq.c linux-4.0.4/fs/aufs/sysrq.c ---- linux-4.0.4.orig/fs/aufs/sysrq.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/sysrq.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,144 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/sysrq.c linux-4.0.5/fs/aufs/sysrq.c +--- linux-4.0.5.orig/fs/aufs/sysrq.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/sysrq.c 2015-06-21 14:07:48.686432781 -0500 +@@ -0,0 +1,157 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -27056,12 +26251,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/sysrq.c linux-4.0.4/fs/aufs/sysrq.c + if (unlikely(err)) + pr_err("err %d (ignored)\n", err); +} -diff -Nur linux-4.0.4.orig/fs/aufs/vdir.c linux-4.0.4/fs/aufs/vdir.c ---- linux-4.0.4.orig/fs/aufs/vdir.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/vdir.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,876 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/vdir.c linux-4.0.5/fs/aufs/vdir.c +--- linux-4.0.5.orig/fs/aufs/vdir.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/vdir.c 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,888 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -27517,7 +26725,6 @@ diff -Nur linux-4.0.4.orig/fs/aufs/vdir.c linux-4.0.4/fs/aufs/vdir.c + || au_nhash_test_known_wh(&arg->whlist, name, nlen)) + goto out; /* already exists or whiteouted */ + -+ sb = arg->file->f_path.dentry->d_sb; + arg->err = au_ino(sb, arg->bindex, h_ino, d_type, &ino); + if (!arg->err) { + if (unlikely(nlen > AUFS_MAX_NAMELEN)) @@ -27936,12 +27143,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/vdir.c linux-4.0.4/fs/aufs/vdir.c + /* smp_mb(); */ + return 0; +} -diff -Nur linux-4.0.4.orig/fs/aufs/vfsub.c linux-4.0.4/fs/aufs/vfsub.c ---- linux-4.0.4.orig/fs/aufs/vfsub.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/vfsub.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,833 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/vfsub.c linux-4.0.5/fs/aufs/vfsub.c +--- linux-4.0.5.orig/fs/aufs/vfsub.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/vfsub.c 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,846 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -28773,12 +27993,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/vfsub.c linux-4.0.4/fs/aufs/vfsub.c + + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/vfsub.h linux-4.0.4/fs/aufs/vfsub.h ---- linux-4.0.4.orig/fs/aufs/vfsub.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/vfsub.h 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,273 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/vfsub.h linux-4.0.5/fs/aufs/vfsub.h +--- linux-4.0.5.orig/fs/aufs/vfsub.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/vfsub.h 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,286 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -29050,12 +28283,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/vfsub.h linux-4.0.4/fs/aufs/vfsub.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_VFSUB_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/wbr_policy.c linux-4.0.4/fs/aufs/wbr_policy.c ---- linux-4.0.4.orig/fs/aufs/wbr_policy.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/wbr_policy.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,752 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/wbr_policy.c linux-4.0.5/fs/aufs/wbr_policy.c +--- linux-4.0.5.orig/fs/aufs/wbr_policy.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/wbr_policy.c 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,765 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -29806,12 +29052,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/wbr_policy.c linux-4.0.4/fs/aufs/wbr_policy.c + .fin = au_wbr_create_fin_mfs + } +}; -diff -Nur linux-4.0.4.orig/fs/aufs/whout.c linux-4.0.4/fs/aufs/whout.c ---- linux-4.0.4.orig/fs/aufs/whout.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/whout.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,1051 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/whout.c linux-4.0.5/fs/aufs/whout.c +--- linux-4.0.5.orig/fs/aufs/whout.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/whout.c 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,1064 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -30861,12 +30120,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/whout.c linux-4.0.4/fs/aufs/whout.c + au_whtmp_rmdir_free(args); + } +} -diff -Nur linux-4.0.4.orig/fs/aufs/whout.h linux-4.0.4/fs/aufs/whout.h ---- linux-4.0.4.orig/fs/aufs/whout.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/whout.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,72 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/whout.h linux-4.0.5/fs/aufs/whout.h +--- linux-4.0.5.orig/fs/aufs/whout.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/whout.h 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,85 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -30937,12 +30209,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/whout.h linux-4.0.4/fs/aufs/whout.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_WHOUT_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/wkq.c linux-4.0.4/fs/aufs/wkq.c ---- linux-4.0.4.orig/fs/aufs/wkq.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/wkq.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,200 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/wkq.c linux-4.0.5/fs/aufs/wkq.c +--- linux-4.0.5.orig/fs/aufs/wkq.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/wkq.c 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,213 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -31141,12 +30426,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/wkq.c linux-4.0.4/fs/aufs/wkq.c + + return err; +} -diff -Nur linux-4.0.4.orig/fs/aufs/wkq.h linux-4.0.4/fs/aufs/wkq.h ---- linux-4.0.4.orig/fs/aufs/wkq.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/wkq.h 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,78 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/wkq.h linux-4.0.5/fs/aufs/wkq.h +--- linux-4.0.5.orig/fs/aufs/wkq.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/wkq.h 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,91 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -31223,12 +30521,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/wkq.h linux-4.0.4/fs/aufs/wkq.h + +#endif /* __KERNEL__ */ +#endif /* __AUFS_WKQ_H__ */ -diff -Nur linux-4.0.4.orig/fs/aufs/xattr.c linux-4.0.4/fs/aufs/xattr.c ---- linux-4.0.4.orig/fs/aufs/xattr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/xattr.c 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,331 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/xattr.c linux-4.0.5/fs/aufs/xattr.c +--- linux-4.0.5.orig/fs/aufs/xattr.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/xattr.c 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,344 @@ +/* + * Copyright (C) 2014-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -31558,12 +30869,25 @@ diff -Nur linux-4.0.4.orig/fs/aufs/xattr.c linux-4.0.4/fs/aufs/xattr.c + /* sb->s_xattr = au_xattr_handlers; */ +} +#endif -diff -Nur linux-4.0.4.orig/fs/aufs/xino.c linux-4.0.4/fs/aufs/xino.c ---- linux-4.0.4.orig/fs/aufs/xino.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/fs/aufs/xino.c 2015-05-30 22:11:30.000000000 +0200 -@@ -0,0 +1,1305 @@ +diff -Nur linux-4.0.5.orig/fs/aufs/xino.c linux-4.0.5/fs/aufs/xino.c +--- linux-4.0.5.orig/fs/aufs/xino.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/fs/aufs/xino.c 2015-06-21 14:07:48.690432781 -0500 +@@ -0,0 +1,1322 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +/* @@ -32280,7 +31604,7 @@ diff -Nur linux-4.0.4.orig/fs/aufs/xino.c linux-4.0.4/fs/aufs/xino.c +{ + struct file *file; + struct dentry *h_parent, *d; -+ struct inode *h_dir; ++ struct inode *h_dir, *inode; + int err; + + /* @@ -32298,12 +31622,16 @@ diff -Nur linux-4.0.4.orig/fs/aufs/xino.c linux-4.0.4/fs/aufs/xino.c + } + + /* keep file count */ ++ err = 0; ++ inode = file_inode(file); + h_parent = dget_parent(file->f_path.dentry); + h_dir = h_parent->d_inode; + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); + /* mnt_want_write() is unnecessary here */ + /* no delegation since it is just created */ -+ err = vfsub_unlink(h_dir, &file->f_path, /*delegated*/NULL, /*force*/0); ++ if (inode->i_nlink) ++ err = vfsub_unlink(h_dir, &file->f_path, /*delegated*/NULL, ++ /*force*/0); + mutex_unlock(&h_dir->i_mutex); + dput(h_parent); + if (unlikely(err)) { @@ -32867,9 +32195,9 @@ diff -Nur linux-4.0.4.orig/fs/aufs/xino.c linux-4.0.4/fs/aufs/xino.c +out: + return err; +} -diff -Nur linux-4.0.4.orig/fs/buffer.c linux-4.0.4/fs/buffer.c ---- linux-4.0.4.orig/fs/buffer.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/buffer.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/buffer.c linux-4.0.5/fs/buffer.c +--- linux-4.0.5.orig/fs/buffer.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/buffer.c 2015-06-21 14:08:25.130432449 -0500 @@ -2450,7 +2450,7 @@ * Update file times before taking page lock. We may end up failing the * fault so this update may be superfluous but who really cares... @@ -32879,9 +32207,9 @@ diff -Nur linux-4.0.4.orig/fs/buffer.c linux-4.0.4/fs/buffer.c ret = __block_page_mkwrite(vma, vmf, get_block); sb_end_pagefault(sb); -diff -Nur linux-4.0.4.orig/fs/dcache.c linux-4.0.4/fs/dcache.c ---- linux-4.0.4.orig/fs/dcache.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/dcache.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/dcache.c linux-4.0.5/fs/dcache.c +--- linux-4.0.5.orig/fs/dcache.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/dcache.c 2015-06-21 14:08:28.354432418 -0500 @@ -1130,7 +1130,7 @@ * * The @enter() and @finish() callbacks are called with d_lock held. @@ -32891,9 +32219,47 @@ diff -Nur linux-4.0.4.orig/fs/dcache.c linux-4.0.4/fs/dcache.c enum d_walk_ret (*enter)(void *, struct dentry *), void (*finish)(void *)) { -diff -Nur linux-4.0.4.orig/fs/Kconfig linux-4.0.4/fs/Kconfig ---- linux-4.0.4.orig/fs/Kconfig 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/Kconfig 2015-05-30 22:11:31.000000000 +0200 +@@ -1235,6 +1235,7 @@ + seq = 1; + goto again; + } ++EXPORT_SYMBOL(d_walk); + + /* + * Search for at least 1 mount point in the dentry's subdirs. +diff -Nur linux-4.0.5.orig/fs/file_table.c linux-4.0.5/fs/file_table.c +--- linux-4.0.5.orig/fs/file_table.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/file_table.c 2015-06-21 14:08:28.358432418 -0500 +@@ -147,6 +147,7 @@ + } + return ERR_PTR(-ENFILE); + } ++EXPORT_SYMBOL(get_empty_filp); + + /** + * alloc_file - allocate and initialize a 'struct file' +@@ -308,6 +309,7 @@ + file_free(file); + } + } ++EXPORT_SYMBOL(put_filp); + + void __init files_init(unsigned long mempages) + { +diff -Nur linux-4.0.5.orig/fs/inode.c linux-4.0.5/fs/inode.c +--- linux-4.0.5.orig/fs/inode.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/inode.c 2015-06-21 14:08:28.358432418 -0500 +@@ -58,6 +58,7 @@ + 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 +diff -Nur linux-4.0.5.orig/fs/Kconfig linux-4.0.5/fs/Kconfig +--- linux-4.0.5.orig/fs/Kconfig 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/Kconfig 2015-06-21 14:08:20.746432489 -0500 @@ -218,6 +218,7 @@ source "fs/ufs/Kconfig" source "fs/exofs/Kconfig" @@ -32902,17 +32268,125 @@ diff -Nur linux-4.0.4.orig/fs/Kconfig linux-4.0.4/fs/Kconfig endif # MISC_FILESYSTEMS -diff -Nur linux-4.0.4.orig/fs/Makefile linux-4.0.4/fs/Makefile ---- linux-4.0.4.orig/fs/Makefile 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/Makefile 2015-05-30 22:11:31.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/Makefile linux-4.0.5/fs/Makefile +--- linux-4.0.5.orig/fs/Makefile 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/Makefile 2015-06-21 14:08:20.746432489 -0500 @@ -126,3 +126,4 @@ obj-$(CONFIG_CEPH_FS) += ceph/ obj-$(CONFIG_PSTORE) += pstore/ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ +obj-$(CONFIG_AUFS_FS) += aufs/ -diff -Nur linux-4.0.4.orig/fs/proc/base.c linux-4.0.4/fs/proc/base.c ---- linux-4.0.4.orig/fs/proc/base.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/proc/base.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/namespace.c linux-4.0.5/fs/namespace.c +--- linux-4.0.5.orig/fs/namespace.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/namespace.c 2015-06-21 14:08:28.358432418 -0500 +@@ -463,6 +463,7 @@ + mnt_dec_writers(real_mount(mnt)); + preempt_enable(); + } ++EXPORT_SYMBOL_GPL(__mnt_drop_write); + + /** + * mnt_drop_write - give up write access to a mount +@@ -1770,6 +1771,7 @@ + } + return 0; + } ++EXPORT_SYMBOL(iterate_mounts); + + static void cleanup_group_ids(struct mount *mnt, struct mount *end) + { +diff -Nur linux-4.0.5.orig/fs/notify/group.c linux-4.0.5/fs/notify/group.c +--- linux-4.0.5.orig/fs/notify/group.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/notify/group.c 2015-06-21 14:08:28.362432418 -0500 +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #include + #include "fsnotify.h" +@@ -72,6 +73,7 @@ + { + 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 @@ + 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 @@ + + return group; + } ++EXPORT_SYMBOL(fsnotify_alloc_group); + + int fsnotify_fasync(int fd, struct file *file, int on) + { +diff -Nur linux-4.0.5.orig/fs/notify/mark.c linux-4.0.5/fs/notify/mark.c +--- linux-4.0.5.orig/fs/notify/mark.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/notify/mark.c 2015-06-21 14:08:28.362432418 -0500 +@@ -109,6 +109,7 @@ + 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 @@ + 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 @@ + + 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 @@ + atomic_set(&mark->refcnt, 1); + mark->free_mark = free_mark; + } ++EXPORT_SYMBOL(fsnotify_init_mark); + + static int fsnotify_mark_destroy(void *ignored) + { +diff -Nur linux-4.0.5.orig/fs/open.c linux-4.0.5/fs/open.c +--- linux-4.0.5.orig/fs/open.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/open.c 2015-06-21 14:08:28.362432418 -0500 +@@ -62,6 +62,7 @@ + mutex_unlock(&dentry->d_inode->i_mutex); + return ret; + } ++EXPORT_SYMBOL(do_truncate); + + long vfs_truncate(struct path *path, loff_t length) + { +@@ -672,6 +673,7 @@ + } + return 0; + } ++EXPORT_SYMBOL(open_check_o_direct); + + static int do_dentry_open(struct file *f, + int (*open)(struct inode *, struct file *), +diff -Nur linux-4.0.5.orig/fs/proc/base.c linux-4.0.5/fs/proc/base.c +--- linux-4.0.5.orig/fs/proc/base.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/proc/base.c 2015-06-21 14:08:25.134432449 -0500 @@ -1735,7 +1735,7 @@ down_read(&mm->mmap_sem); vma = find_exact_vma(mm, vm_start, vm_end); @@ -32922,9 +32396,9 @@ diff -Nur linux-4.0.4.orig/fs/proc/base.c linux-4.0.4/fs/proc/base.c path_get(path); rc = 0; } -diff -Nur linux-4.0.4.orig/fs/proc/nommu.c linux-4.0.4/fs/proc/nommu.c ---- linux-4.0.4.orig/fs/proc/nommu.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/proc/nommu.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/proc/nommu.c linux-4.0.5/fs/proc/nommu.c +--- linux-4.0.5.orig/fs/proc/nommu.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/proc/nommu.c 2015-06-21 14:08:25.134432449 -0500 @@ -45,7 +45,10 @@ file = region->vm_file; @@ -32937,9 +32411,9 @@ diff -Nur linux-4.0.4.orig/fs/proc/nommu.c linux-4.0.4/fs/proc/nommu.c dev = inode->i_sb->s_dev; ino = inode->i_ino; } -diff -Nur linux-4.0.4.orig/fs/proc/task_mmu.c linux-4.0.4/fs/proc/task_mmu.c ---- linux-4.0.4.orig/fs/proc/task_mmu.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/proc/task_mmu.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/proc/task_mmu.c linux-4.0.5/fs/proc/task_mmu.c +--- linux-4.0.5.orig/fs/proc/task_mmu.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/proc/task_mmu.c 2015-06-21 14:08:25.134432449 -0500 @@ -279,7 +279,10 @@ const char *name = NULL; @@ -32961,9 +32435,9 @@ diff -Nur linux-4.0.4.orig/fs/proc/task_mmu.c linux-4.0.4/fs/proc/task_mmu.c struct mm_struct *mm = vma->vm_mm; struct mm_walk walk = { .hugetlb_entry = gather_hugetlb_stats, -diff -Nur linux-4.0.4.orig/fs/proc/task_nommu.c linux-4.0.4/fs/proc/task_nommu.c ---- linux-4.0.4.orig/fs/proc/task_nommu.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/proc/task_nommu.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/proc/task_nommu.c linux-4.0.5/fs/proc/task_nommu.c +--- linux-4.0.5.orig/fs/proc/task_nommu.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/proc/task_nommu.c 2015-06-21 14:08:25.134432449 -0500 @@ -160,7 +160,10 @@ file = vma->vm_file; @@ -32971,14 +32445,14 @@ diff -Nur linux-4.0.4.orig/fs/proc/task_nommu.c linux-4.0.4/fs/proc/task_nommu.c - struct inode *inode = file_inode(vma->vm_file); + struct inode *inode; + -+ file = vma_pr_or_file(file); ++ 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; -diff -Nur linux-4.0.4.orig/fs/splice.c linux-4.0.4/fs/splice.c ---- linux-4.0.4.orig/fs/splice.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/fs/splice.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/fs/splice.c linux-4.0.5/fs/splice.c +--- linux-4.0.5.orig/fs/splice.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/splice.c 2015-06-21 14:08:28.362432418 -0500 @@ -1099,8 +1099,8 @@ /* * Attempt to initiate a splice from pipe to file. @@ -32990,7 +32464,12 @@ diff -Nur linux-4.0.4.orig/fs/splice.c linux-4.0.4/fs/splice.c { ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); -@@ -1116,9 +1116,9 @@ +@@ -1112,13 +1112,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. */ @@ -33003,9 +32482,28 @@ diff -Nur linux-4.0.4.orig/fs/splice.c linux-4.0.4/fs/splice.c { ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); -diff -Nur linux-4.0.4.orig/include/linux/file.h linux-4.0.4/include/linux/file.h ---- linux-4.0.4.orig/include/linux/file.h 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/include/linux/file.h 2015-05-30 22:11:31.000000000 +0200 +@@ -1138,6 +1139,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 +diff -Nur linux-4.0.5.orig/fs/xattr.c linux-4.0.5/fs/xattr.c +--- linux-4.0.5.orig/fs/xattr.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/fs/xattr.c 2015-06-21 14:08:28.362432418 -0500 +@@ -207,6 +207,7 @@ + *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, +diff -Nur linux-4.0.5.orig/include/linux/file.h linux-4.0.5/include/linux/file.h +--- linux-4.0.5.orig/include/linux/file.h 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/include/linux/file.h 2015-06-21 14:08:17.150432522 -0500 @@ -19,6 +19,7 @@ struct path; extern struct file *alloc_file(struct path *, fmode_t mode, @@ -33014,14 +32512,13 @@ diff -Nur linux-4.0.4.orig/include/linux/file.h linux-4.0.4/include/linux/file.h static inline void fput_light(struct file *file, int fput_needed) { -diff -Nur linux-4.0.4.orig/include/linux/mm.h linux-4.0.4/include/linux/mm.h ---- linux-4.0.4.orig/include/linux/mm.h 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/include/linux/mm.h 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/include/linux/mm.h linux-4.0.5/include/linux/mm.h +--- linux-4.0.5.orig/include/linux/mm.h 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/include/linux/mm.h 2015-06-21 14:08:25.138432449 -0500 @@ -1254,6 +1254,28 @@ } #endif -+#ifdef CONFIG_MMU +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); @@ -33034,21 +32531,22 @@ diff -Nur linux-4.0.4.orig/include/linux/mm.h linux-4.0.4/include/linux/mm.h + __LINE__) +#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__) +#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__) -+#else ++ ++#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 */ ++#endif /* !CONFIG_MMU */ + extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, int write); -diff -Nur linux-4.0.4.orig/include/linux/mm_types.h linux-4.0.4/include/linux/mm_types.h ---- linux-4.0.4.orig/include/linux/mm_types.h 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/include/linux/mm_types.h 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/include/linux/mm_types.h linux-4.0.5/include/linux/mm_types.h +--- linux-4.0.5.orig/include/linux/mm_types.h 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/include/linux/mm_types.h 2015-06-21 14:08:25.138432449 -0500 @@ -241,6 +241,7 @@ unsigned long vm_top; /* region allocated to here */ unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ @@ -33065,9 +32563,9 @@ diff -Nur linux-4.0.4.orig/include/linux/mm_types.h linux-4.0.4/include/linux/mm void * vm_private_data; /* was vm_pte (shared mem) */ #ifndef CONFIG_MMU -diff -Nur linux-4.0.4.orig/include/linux/splice.h linux-4.0.4/include/linux/splice.h ---- linux-4.0.4.orig/include/linux/splice.h 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/include/linux/splice.h 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/include/linux/splice.h linux-4.0.5/include/linux/splice.h +--- linux-4.0.5.orig/include/linux/splice.h 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/include/linux/splice.h 2015-06-21 14:08:17.150432522 -0500 @@ -83,4 +83,10 @@ extern void spd_release_page(struct splice_pipe_desc *, unsigned int); @@ -33079,12 +32577,25 @@ diff -Nur linux-4.0.4.orig/include/linux/splice.h linux-4.0.4/include/linux/spli + struct pipe_inode_info *pipe, size_t len, + unsigned int flags); #endif -diff -Nur linux-4.0.4.orig/include/uapi/linux/aufs_type.h linux-4.0.4/include/uapi/linux/aufs_type.h ---- linux-4.0.4.orig/include/uapi/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/include/uapi/linux/aufs_type.h 2015-05-30 22:11:31.000000000 +0200 -@@ -0,0 +1,406 @@ +diff -Nur linux-4.0.5.orig/include/uapi/linux/aufs_type.h linux-4.0.5/include/uapi/linux/aufs_type.h +--- linux-4.0.5.orig/include/uapi/linux/aufs_type.h 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/include/uapi/linux/aufs_type.h 2015-06-21 14:09:29.158432082 -0500 +@@ -0,0 +1,419 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima ++ * ++ * This program, aufs is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + +#ifndef __AUFS_TYPE_H__ @@ -33111,7 +32622,7 @@ diff -Nur linux-4.0.4.orig/include/uapi/linux/aufs_type.h linux-4.0.4/include/ua + +#include + -+#define AUFS_VERSION "4.0" ++#define AUFS_VERSION "4.0-20150622" + +/* todo? move this to linux-2.6.19/include/magic.h */ +#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') @@ -33489,9 +33000,9 @@ diff -Nur linux-4.0.4.orig/include/uapi/linux/aufs_type.h linux-4.0.4/include/ua +#define AUFS_CTL_FHSM_FD _IOW(AuCtlType, AuCtl_FHSM_FD, int) + +#endif /* __AUFS_TYPE_H__ */ -diff -Nur linux-4.0.4.orig/include/uapi/linux/Kbuild linux-4.0.4/include/uapi/linux/Kbuild ---- linux-4.0.4.orig/include/uapi/linux/Kbuild 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/include/uapi/linux/Kbuild 2015-05-30 22:11:31.000000000 +0200 +diff -Nur linux-4.0.5.orig/include/uapi/linux/Kbuild linux-4.0.5/include/uapi/linux/Kbuild +--- linux-4.0.5.orig/include/uapi/linux/Kbuild 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/include/uapi/linux/Kbuild 2015-06-21 14:08:20.746432489 -0500 @@ -58,6 +58,7 @@ header-y += atm_tcp.h header-y += atm_zatm.h @@ -33500,9 +33011,9 @@ diff -Nur linux-4.0.4.orig/include/uapi/linux/Kbuild linux-4.0.4/include/uapi/li header-y += auto_fs4.h header-y += auto_fs.h header-y += auxvec.h -diff -Nur linux-4.0.4.orig/kernel/fork.c linux-4.0.4/kernel/fork.c ---- linux-4.0.4.orig/kernel/fork.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/kernel/fork.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/kernel/fork.c linux-4.0.5/kernel/fork.c +--- linux-4.0.5.orig/kernel/fork.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/kernel/fork.c 2015-06-21 14:08:25.138432449 -0500 @@ -430,7 +430,7 @@ struct inode *inode = file_inode(file); struct address_space *mapping = file->f_mapping; @@ -33512,9 +33023,9 @@ diff -Nur linux-4.0.4.orig/kernel/fork.c linux-4.0.4/kernel/fork.c if (tmp->vm_flags & VM_DENYWRITE) atomic_dec(&inode->i_writecount); i_mmap_lock_write(mapping); -diff -Nur linux-4.0.4.orig/MAINTAINERS linux-4.0.4/MAINTAINERS ---- linux-4.0.4.orig/MAINTAINERS 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/MAINTAINERS 2015-05-30 22:11:31.000000000 +0200 +diff -Nur linux-4.0.5.orig/MAINTAINERS linux-4.0.5/MAINTAINERS +--- linux-4.0.5.orig/MAINTAINERS 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/MAINTAINERS 2015-06-21 14:08:17.142432521 -0500 @@ -1864,6 +1864,19 @@ F: include/uapi/linux/audit.h F: kernel/audit* @@ -33535,9 +33046,9 @@ diff -Nur linux-4.0.4.orig/MAINTAINERS linux-4.0.4/MAINTAINERS AUXILIARY DISPLAY DRIVERS M: Miguel Ojeda Sandonis W: http://miguelojeda.es/auxdisplay.htm -diff -Nur linux-4.0.4.orig/mm/filemap.c linux-4.0.4/mm/filemap.c ---- linux-4.0.4.orig/mm/filemap.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/mm/filemap.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/mm/filemap.c linux-4.0.5/mm/filemap.c +--- linux-4.0.5.orig/mm/filemap.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/mm/filemap.c 2015-06-21 14:08:25.142432449 -0500 @@ -2064,7 +2064,7 @@ int ret = VM_FAULT_LOCKED; @@ -33547,9 +33058,9 @@ diff -Nur linux-4.0.4.orig/mm/filemap.c linux-4.0.4/mm/filemap.c lock_page(page); if (page->mapping != inode->i_mapping) { unlock_page(page); -diff -Nur linux-4.0.4.orig/mm/madvise.c linux-4.0.4/mm/madvise.c ---- linux-4.0.4.orig/mm/madvise.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/mm/madvise.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/mm/madvise.c linux-4.0.5/mm/madvise.c +--- linux-4.0.5.orig/mm/madvise.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/mm/madvise.c 2015-06-21 14:08:25.142432449 -0500 @@ -320,12 +320,12 @@ * vma's reference to the file) can go away as soon as we drop * mmap_sem. @@ -33565,9 +33076,9 @@ diff -Nur linux-4.0.4.orig/mm/madvise.c linux-4.0.4/mm/madvise.c down_read(¤t->mm->mmap_sem); return error; } -diff -Nur linux-4.0.4.orig/mm/Makefile linux-4.0.4/mm/Makefile ---- linux-4.0.4.orig/mm/Makefile 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/mm/Makefile 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/mm/Makefile linux-4.0.5/mm/Makefile +--- linux-4.0.5.orig/mm/Makefile 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/mm/Makefile 2015-06-21 14:08:25.142432449 -0500 @@ -21,7 +21,7 @@ mm_init.o mmu_context.o percpu.o slab_common.o \ compaction.o vmacache.o \ @@ -33577,9 +33088,9 @@ diff -Nur linux-4.0.4.orig/mm/Makefile linux-4.0.4/mm/Makefile obj-y += init-mm.o -diff -Nur linux-4.0.4.orig/mm/memory.c linux-4.0.4/mm/memory.c ---- linux-4.0.4.orig/mm/memory.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/mm/memory.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/mm/memory.c linux-4.0.5/mm/memory.c +--- linux-4.0.5.orig/mm/memory.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/mm/memory.c 2015-06-21 14:08:25.142432449 -0500 @@ -2132,7 +2132,7 @@ } @@ -33589,9 +33100,9 @@ diff -Nur linux-4.0.4.orig/mm/memory.c linux-4.0.4/mm/memory.c } return ret; -diff -Nur linux-4.0.4.orig/mm/mmap.c linux-4.0.4/mm/mmap.c ---- linux-4.0.4.orig/mm/mmap.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/mm/mmap.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/mm/mmap.c linux-4.0.5/mm/mmap.c +--- linux-4.0.5.orig/mm/mmap.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/mm/mmap.c 2015-06-21 14:08:25.142432449 -0500 @@ -274,7 +274,7 @@ if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); @@ -33668,9 +33179,9 @@ diff -Nur linux-4.0.4.orig/mm/mmap.c linux-4.0.4/mm/mmap.c 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); -diff -Nur linux-4.0.4.orig/mm/msync.c linux-4.0.4/mm/msync.c ---- linux-4.0.4.orig/mm/msync.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/mm/msync.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/mm/msync.c linux-4.0.5/mm/msync.c +--- linux-4.0.5.orig/mm/msync.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/mm/msync.c 2015-06-21 14:08:25.142432449 -0500 @@ -84,10 +84,10 @@ start = vma->vm_end; if ((flags & MS_SYNC) && file && @@ -33684,9 +33195,9 @@ diff -Nur linux-4.0.4.orig/mm/msync.c linux-4.0.4/mm/msync.c if (error || start >= end) goto out; down_read(&mm->mmap_sem); -diff -Nur linux-4.0.4.orig/mm/nommu.c linux-4.0.4/mm/nommu.c ---- linux-4.0.4.orig/mm/nommu.c 2015-05-17 18:55:21.000000000 +0200 -+++ linux-4.0.4/mm/nommu.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/mm/nommu.c linux-4.0.5/mm/nommu.c +--- linux-4.0.5.orig/mm/nommu.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/mm/nommu.c 2015-06-21 14:08:25.142432449 -0500 @@ -693,7 +693,7 @@ up_write(&nommu_region_sem); @@ -33727,9 +33238,9 @@ diff -Nur linux-4.0.4.orig/mm/nommu.c linux-4.0.4/mm/nommu.c kmem_cache_free(vm_area_cachep, vma); kleave(" = %d", ret); return ret; -diff -Nur linux-4.0.4.orig/mm/prfile.c linux-4.0.4/mm/prfile.c ---- linux-4.0.4.orig/mm/prfile.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-4.0.4/mm/prfile.c 2015-05-30 22:11:30.000000000 +0200 +diff -Nur linux-4.0.5.orig/mm/prfile.c linux-4.0.5/mm/prfile.c +--- linux-4.0.5.orig/mm/prfile.c 1969-12-31 18:00:00.000000000 -0600 ++++ linux-4.0.5/mm/prfile.c 2015-06-21 14:08:25.142432449 -0500 @@ -0,0 +1,86 @@ +/* + * Mainly for aufs which mmap(2) diffrent file and wants to print different path @@ -33757,7 +33268,6 @@ diff -Nur linux-4.0.4.orig/mm/prfile.c linux-4.0.4/mm/prfile.c +#endif +} + -+#ifdef CONFIG_MMU +void vma_do_file_update_time(struct vm_area_struct *vma, const char func[], + int line) +{ @@ -33797,7 +33307,8 @@ diff -Nur linux-4.0.4.orig/mm/prfile.c linux-4.0.4/mm/prfile.c + if (f && pr) + fput(pr); +} -+#else ++ ++#ifndef CONFIG_MMU +struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[], + int line) +{ @@ -33816,4 +33327,121 @@ diff -Nur linux-4.0.4.orig/mm/prfile.c linux-4.0.4/mm/prfile.c + if (f && pr) + fput(pr); +} -+#endif /* CONFIG_MMU */ ++#endif /* !CONFIG_MMU */ +diff -Nur linux-4.0.5.orig/security/commoncap.c linux-4.0.5/security/commoncap.c +--- linux-4.0.5.orig/security/commoncap.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/security/commoncap.c 2015-06-21 14:08:28.366432418 -0500 +@@ -975,9 +975,11 @@ + } + 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); +diff -Nur linux-4.0.5.orig/security/device_cgroup.c linux-4.0.5/security/device_cgroup.c +--- linux-4.0.5.orig/security/device_cgroup.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/security/device_cgroup.c 2015-06-21 14:08:28.366432418 -0500 +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -849,6 +850,7 @@ + return __devcgroup_check_permission(type, imajor(inode), iminor(inode), + access); + } ++EXPORT_SYMBOL(__devcgroup_inode_permission); + + int devcgroup_inode_mknod(int mode, dev_t dev) + { +diff -Nur linux-4.0.5.orig/security/security.c linux-4.0.5/security/security.c +--- linux-4.0.5.orig/security/security.c 2015-06-06 10:21:22.000000000 -0500 ++++ linux-4.0.5/security/security.c 2015-06-21 14:08:28.366432418 -0500 +@@ -430,6 +430,7 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + + return fsnotify_perm(file, mask); + } ++EXPORT_SYMBOL(security_file_permission); + + int security_file_alloc(struct file *file) + { +@@ -775,6 +784,7 @@ + return ret; + return ima_file_mmap(file, prot); + } ++EXPORT_SYMBOL(security_mmap_file); + + int security_mmap_addr(unsigned long addr) + { -- cgit v1.2.3