Commit ae98dd42 authored by J. R. Okajima's avatar J. R. Okajima
Browse files

5.x-rcN 20210809


Signed-off-by: default avatarJ. R. Okajima <hooanon05g@gmail.com>
parent 84c52647
...@@ -2,10 +2,10 @@ SPDX-License-Identifier: GPL-2.0 ...@@ -2,10 +2,10 @@ SPDX-License-Identifier: GPL-2.0
aufs5.x-rcN base patch aufs5.x-rcN base patch
diff --git a/MAINTAINERS b/MAINTAINERS diff --git a/MAINTAINERS b/MAINTAINERS
index a61f4f3b78a91..10df06370b3ae 100644 index c9467d2839f5e..f97da4f009ae2 100644
--- a/MAINTAINERS --- a/MAINTAINERS
+++ b/MAINTAINERS +++ b/MAINTAINERS
@@ -3088,6 +3088,19 @@ F: include/uapi/linux/audit.h @@ -3089,6 +3089,19 @@ F: include/uapi/linux/audit.h
F: kernel/audit* F: kernel/audit*
F: lib/*audit.c F: lib/*audit.c
...@@ -26,10 +26,10 @@ index a61f4f3b78a91..10df06370b3ae 100644 ...@@ -26,10 +26,10 @@ index a61f4f3b78a91..10df06370b3ae 100644
M: Miguel Ojeda <ojeda@kernel.org> M: Miguel Ojeda <ojeda@kernel.org>
S: Maintained S: Maintained
diff --git a/drivers/block/loop.c b/drivers/block/loop.c diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index f37b9e3d833c2..95ee02f0581f8 100644 index f0cdff0c5fbf4..e65f941a4181a 100644
--- a/drivers/block/loop.c --- a/drivers/block/loop.c
+++ b/drivers/block/loop.c +++ b/drivers/block/loop.c
@@ -758,6 +758,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, @@ -810,6 +810,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
return error; return error;
} }
...@@ -68,7 +68,7 @@ index cf871a81f4fdc..bc5095b734f58 100644 ...@@ -68,7 +68,7 @@ index cf871a81f4fdc..bc5095b734f58 100644
{ {
struct dentry *this_parent; struct dentry *this_parent;
diff --git a/fs/fcntl.c b/fs/fcntl.c diff --git a/fs/fcntl.c b/fs/fcntl.c
index dfc72f15be7fc..d8a12eb63961d 100644 index f946bec8f1f1b..a44da05bcb9a6 100644
--- a/fs/fcntl.c --- a/fs/fcntl.c
+++ b/fs/fcntl.c +++ b/fs/fcntl.c
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
......
...@@ -14,10 +14,10 @@ index a7749c126b8e2..12fd57d4aa57e 100644 ...@@ -14,10 +14,10 @@ index a7749c126b8e2..12fd57d4aa57e 100644
endif # MISC_FILESYSTEMS endif # MISC_FILESYSTEMS
diff --git a/fs/Makefile b/fs/Makefile diff --git a/fs/Makefile b/fs/Makefile
index 9c708e1fbe8fb..fde6be84a0830 100644 index f98f3e691c376..5e9aaa284700e 100644
--- a/fs/Makefile --- a/fs/Makefile
+++ b/fs/Makefile +++ b/fs/Makefile
@@ -136,3 +136,4 @@ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ @@ -135,3 +135,4 @@ obj-$(CONFIG_EFIVAR_FS) += efivarfs/
obj-$(CONFIG_EROFS_FS) += erofs/ obj-$(CONFIG_EROFS_FS) += erofs/
obj-$(CONFIG_VBOXSF_FS) += vboxsf/ obj-$(CONFIG_VBOXSF_FS) += vboxsf/
obj-$(CONFIG_ZONEFS_FS) += zonefs/ obj-$(CONFIG_ZONEFS_FS) += zonefs/
......
...@@ -2,10 +2,10 @@ SPDX-License-Identifier: GPL-2.0 ...@@ -2,10 +2,10 @@ SPDX-License-Identifier: GPL-2.0
aufs5.x-rcN loopback patch aufs5.x-rcN loopback patch
diff --git a/drivers/block/loop.c b/drivers/block/loop.c diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 95ee02f0581f8..d6152d7580b7d 100644 index e65f941a4181a..ce11efab143b7 100644
--- a/drivers/block/loop.c --- a/drivers/block/loop.c
+++ b/drivers/block/loop.c +++ b/drivers/block/loop.c
@@ -644,6 +644,15 @@ static inline void loop_update_dio(struct loop_device *lo) @@ -685,6 +685,15 @@ static inline void loop_update_dio(struct loop_device *lo)
lo->use_dio); lo->use_dio);
} }
...@@ -21,25 +21,25 @@ index 95ee02f0581f8..d6152d7580b7d 100644 ...@@ -21,25 +21,25 @@ index 95ee02f0581f8..d6152d7580b7d 100644
static void loop_reread_partitions(struct loop_device *lo) static void loop_reread_partitions(struct loop_device *lo)
{ {
int rc; int rc;
@@ -698,6 +707,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, @@ -742,6 +751,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
unsigned int arg)
{ {
struct file *file = NULL, *old_file; struct file *file = fget(arg);
+ struct file *f, *virt_file = NULL, *old_virt_file; struct file *old_file;
int error; + struct file *f, *virt_file = NULL, *old_virt_file;
bool partscan; int error;
bool partscan;
@@ -717,12 +727,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, bool is_loop;
file = fget(arg); @@ -761,11 +771,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
if (!file) if (!(lo->lo_flags & LO_FLAGS_READ_ONLY))
goto out_err; goto out_err;
+ f = loop_real_file(file); + f = loop_real_file(file);
+ if (f) { + if (f) {
+ virt_file = file; + virt_file = file;
+ file = f; + file = f;
+ get_file(file); + get_file(file);
+ } + }
+
error = loop_validate_file(file, bdev); error = loop_validate_file(file, bdev);
if (error) if (error)
goto out_err; goto out_err;
...@@ -49,7 +49,7 @@ index 95ee02f0581f8..d6152d7580b7d 100644 ...@@ -49,7 +49,7 @@ index 95ee02f0581f8..d6152d7580b7d 100644
error = -EINVAL; error = -EINVAL;
@@ -734,6 +751,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, @@ -777,6 +795,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
blk_mq_freeze_queue(lo->lo_queue); blk_mq_freeze_queue(lo->lo_queue);
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask); mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
lo->lo_backing_file = file; lo->lo_backing_file = file;
...@@ -57,7 +57,7 @@ index 95ee02f0581f8..d6152d7580b7d 100644 ...@@ -57,7 +57,7 @@ index 95ee02f0581f8..d6152d7580b7d 100644
lo->old_gfp_mask = mapping_gfp_mask(file->f_mapping); lo->old_gfp_mask = mapping_gfp_mask(file->f_mapping);
mapping_set_gfp_mask(file->f_mapping, mapping_set_gfp_mask(file->f_mapping,
lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS)); lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
@@ -747,6 +765,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, @@ -799,6 +818,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
* dependency. * dependency.
*/ */
fput(old_file); fput(old_file);
...@@ -66,38 +66,38 @@ index 95ee02f0581f8..d6152d7580b7d 100644 ...@@ -66,38 +66,38 @@ index 95ee02f0581f8..d6152d7580b7d 100644
if (partscan) if (partscan)
loop_reread_partitions(lo); loop_reread_partitions(lo);
return 0; return 0;
@@ -755,6 +775,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, @@ -807,6 +828,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
mutex_unlock(&lo->lo_mutex); loop_global_unlock(lo, is_loop);
if (file) out_putf:
fput(file); fput(file);
+ if (virt_file) + if (virt_file)
+ fput(virt_file); + fput(virt_file);
return error; return error;
} }
@@ -1154,7 +1176,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode, @@ -1207,6 +1230,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
struct block_device *bdev,
const struct loop_config *config) const struct loop_config *config)
{ {
- struct file *file; struct file *file = fget(config->fd);
+ struct file *file, *f, *virt_file = NULL; + struct file *f, *virt_file = NULL;
struct inode *inode; struct inode *inode;
struct address_space *mapping; struct address_space *mapping;
int error; int error;
@@ -1169,6 +1191,12 @@ static int loop_configure(struct loop_device *lo, fmode_t mode, @@ -1222,6 +1246,13 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
file = fget(config->fd); /* This is safe, since we have a reference from open(). */
if (!file) __module_get(THIS_MODULE);
goto out;
+ f = loop_real_file(file); + f = loop_real_file(file);
+ if (f) { + if (f) {
+ virt_file = file; + virt_file = file;
+ file = f; + file = f;
+ get_file(file); + get_file(file);
+ } + }
+
/* /*
* If we don't hold exclusive handle for the device, upgrade to it * If we don't hold exclusive handle for the device, upgrade to it
@@ -1234,6 +1262,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode, * here to avoid changing device under exclusive owner.
@@ -1286,6 +1317,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
lo->use_dio = lo->lo_flags & LO_FLAGS_DIRECT_IO; lo->use_dio = lo->lo_flags & LO_FLAGS_DIRECT_IO;
lo->lo_device = bdev; lo->lo_device = bdev;
lo->lo_backing_file = file; lo->lo_backing_file = file;
...@@ -105,16 +105,16 @@ index 95ee02f0581f8..d6152d7580b7d 100644 ...@@ -105,16 +105,16 @@ index 95ee02f0581f8..d6152d7580b7d 100644
lo->old_gfp_mask = mapping_gfp_mask(mapping); lo->old_gfp_mask = mapping_gfp_mask(mapping);
mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS)); mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
@@ -1285,6 +1314,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode, @@ -1340,6 +1372,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
bd_abort_claiming(bdev, loop_configure); bd_abort_claiming(bdev, loop_configure);
out_putf: out_putf:
fput(file); fput(file);
+ if (virt_file) + if (virt_file)
+ fput(virt_file); + fput(virt_file);
out:
/* This is safe: open() is still holding a reference. */ /* This is safe: open() is still holding a reference. */
module_put(THIS_MODULE); module_put(THIS_MODULE);
@@ -1294,6 +1325,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode, return error;
@@ -1348,6 +1382,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
static int __loop_clr_fd(struct loop_device *lo, bool release) static int __loop_clr_fd(struct loop_device *lo, bool release)
{ {
struct file *filp = NULL; struct file *filp = NULL;
...@@ -122,7 +122,7 @@ index 95ee02f0581f8..d6152d7580b7d 100644 ...@@ -122,7 +122,7 @@ index 95ee02f0581f8..d6152d7580b7d 100644
gfp_t gfp = lo->old_gfp_mask; gfp_t gfp = lo->old_gfp_mask;
struct block_device *bdev = lo->lo_device; struct block_device *bdev = lo->lo_device;
int err = 0; int err = 0;
@@ -1333,6 +1365,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release) @@ -1399,6 +1434,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
spin_lock_irq(&lo->lo_lock); spin_lock_irq(&lo->lo_lock);
lo->lo_backing_file = NULL; lo->lo_backing_file = NULL;
...@@ -130,7 +130,7 @@ index 95ee02f0581f8..d6152d7580b7d 100644 ...@@ -130,7 +130,7 @@ index 95ee02f0581f8..d6152d7580b7d 100644
spin_unlock_irq(&lo->lo_lock); spin_unlock_irq(&lo->lo_lock);
loop_release_xfer(lo); loop_release_xfer(lo);
@@ -1413,6 +1446,8 @@ static int __loop_clr_fd(struct loop_device *lo, bool release) @@ -1479,6 +1515,8 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
*/ */
if (filp) if (filp)
fput(filp); fput(filp);
......
...@@ -72,10 +72,10 @@ index a6d21fc0033c6..02c2de31196e0 100644 ...@@ -72,10 +72,10 @@ index a6d21fc0033c6..02c2de31196e0 100644
ino = inode->i_ino; ino = inode->i_ino;
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
diff --git a/include/linux/mm.h b/include/linux/mm.h diff --git a/include/linux/mm.h b/include/linux/mm.h
index 57453dba41b94..74008c15418d4 100644 index 7ca22e6e694a8..c7c40fd7f65a6 100644
--- a/include/linux/mm.h --- a/include/linux/mm.h
+++ b/include/linux/mm.h +++ b/include/linux/mm.h
@@ -1804,6 +1804,28 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, @@ -1805,6 +1805,28 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
unmap_mapping_range(mapping, holebegin, holelen, 0); unmap_mapping_range(mapping, holebegin, holelen, 0);
} }
......
...@@ -34,7 +34,7 @@ index 38f63451b9282..7710637ed0bc9 100644 ...@@ -34,7 +34,7 @@ index 38f63451b9282..7710637ed0bc9 100644
#ifdef CONFIG_USELIB #ifdef CONFIG_USELIB
/* /*
diff --git a/fs/fcntl.c b/fs/fcntl.c diff --git a/fs/fcntl.c b/fs/fcntl.c
index d8a12eb63961d..0532996186311 100644 index a44da05bcb9a6..a9cf3ad532923 100644
--- a/fs/fcntl.c --- a/fs/fcntl.c
+++ b/fs/fcntl.c +++ b/fs/fcntl.c
@@ -86,6 +86,7 @@ int setfl(int fd, struct file *filp, unsigned long arg) @@ -86,6 +86,7 @@ int setfl(int fd, struct file *filp, unsigned long arg)
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <limits.h> #include <limits.h>
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#define AUFS_VERSION "5.x-rcN-20210719" #define AUFS_VERSION "5.x-rcN-20210809"
/* todo? move this to linux-2.6.19/include/magic.h */ /* todo? move this to linux-2.6.19/include/magic.h */
#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') #define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment