mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-23 18:42:55 +00:00
parent
a3d09ffc80
commit
f03e705fe0
1 changed files with 14 additions and 14 deletions
|
@ -1950,7 +1950,7 @@ index edc32575828b..d80625ae4c12 100644
|
|||
M: Miguel Ojeda <ojeda@kernel.org>
|
||||
S: Maintained
|
||||
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
|
||||
index 79e485949b60..44fe18055d44 100644
|
||||
index c96bdb3e7ac5..8a686e88b13c 100644
|
||||
--- a/drivers/block/loop.c
|
||||
+++ b/drivers/block/loop.c
|
||||
@@ -673,6 +673,15 @@ static inline void loop_update_dio(struct loop_device *lo)
|
||||
|
@ -1977,7 +1977,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
int error;
|
||||
bool partscan;
|
||||
bool is_loop;
|
||||
@@ -749,11 +759,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
|
||||
@@ -753,11 +763,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
|
||||
if (!(lo->lo_flags & LO_FLAGS_READ_ONLY))
|
||||
goto out_err;
|
||||
|
||||
|
@ -1997,7 +1997,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
|
||||
error = -EINVAL;
|
||||
|
||||
@@ -766,6 +784,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
|
||||
@@ -770,6 +788,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
|
||||
blk_mq_freeze_queue(lo->lo_queue);
|
||||
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
|
||||
lo->lo_backing_file = file;
|
||||
|
@ -2005,7 +2005,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
lo->old_gfp_mask = mapping_gfp_mask(file->f_mapping);
|
||||
mapping_set_gfp_mask(file->f_mapping,
|
||||
lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
|
||||
@@ -788,6 +807,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
|
||||
@@ -792,6 +811,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
|
||||
* dependency.
|
||||
*/
|
||||
fput(old_file);
|
||||
|
@ -2013,14 +2013,14 @@ index 79e485949b60..44fe18055d44 100644
|
|||
+ fput(old_virt_file);
|
||||
if (partscan)
|
||||
loop_reread_partitions(lo);
|
||||
return 0;
|
||||
@@ -796,9 +817,29 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
|
||||
|
||||
@@ -805,9 +826,29 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
|
||||
loop_global_unlock(lo, is_loop);
|
||||
out_putf:
|
||||
fput(file);
|
||||
+ if (virt_file)
|
||||
+ fput(virt_file);
|
||||
return error;
|
||||
goto done;
|
||||
}
|
||||
|
||||
+/*
|
||||
|
@ -2044,7 +2044,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
/* loop sysfs attributes */
|
||||
|
||||
static ssize_t loop_attr_show(struct device *dev, char *page,
|
||||
@@ -1188,6 +1229,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
@@ -1197,6 +1238,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
const struct loop_config *config)
|
||||
{
|
||||
struct file *file = fget(config->fd);
|
||||
|
@ -2052,7 +2052,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
struct inode *inode;
|
||||
struct address_space *mapping;
|
||||
int error;
|
||||
@@ -1203,6 +1245,13 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
@@ -1212,6 +1254,13 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
/* This is safe, since we have a reference from open(). */
|
||||
__module_get(THIS_MODULE);
|
||||
|
||||
|
@ -2066,7 +2066,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
/*
|
||||
* If we don't hold exclusive handle for the device, upgrade to it
|
||||
* here to avoid changing device under exclusive owner.
|
||||
@@ -1268,6 +1317,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
@@ -1280,6 +1329,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
lo->use_dio = lo->lo_flags & LO_FLAGS_DIRECT_IO;
|
||||
lo->lo_device = bdev;
|
||||
lo->lo_backing_file = file;
|
||||
|
@ -2074,7 +2074,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
lo->old_gfp_mask = mapping_gfp_mask(mapping);
|
||||
mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
|
||||
|
||||
@@ -1318,6 +1368,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
@@ -1335,6 +1385,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
bd_abort_claiming(bdev, loop_configure);
|
||||
out_putf:
|
||||
fput(file);
|
||||
|
@ -2083,7 +2083,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
/* This is safe: open() is still holding a reference. */
|
||||
module_put(THIS_MODULE);
|
||||
return error;
|
||||
@@ -1326,6 +1378,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
@@ -1343,6 +1395,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||
static int __loop_clr_fd(struct loop_device *lo, bool release)
|
||||
{
|
||||
struct file *filp = NULL;
|
||||
|
@ -2091,7 +2091,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
gfp_t gfp = lo->old_gfp_mask;
|
||||
struct block_device *bdev = lo->lo_device;
|
||||
int err = 0;
|
||||
@@ -1377,6 +1430,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
|
||||
@@ -1394,6 +1447,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
|
||||
|
||||
spin_lock_irq(&lo->lo_lock);
|
||||
lo->lo_backing_file = NULL;
|
||||
|
@ -2099,7 +2099,7 @@ index 79e485949b60..44fe18055d44 100644
|
|||
spin_unlock_irq(&lo->lo_lock);
|
||||
|
||||
loop_release_xfer(lo);
|
||||
@@ -1457,6 +1511,8 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
|
||||
@@ -1474,6 +1528,8 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
|
||||
*/
|
||||
if (filp)
|
||||
fput(filp);
|
||||
|
|
Loading…
Add table
Reference in a new issue