[PATCH] loop: Add file_xxx_write() wrapping around call of fallocate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



FALLOC_FL_PUNCH_HOLE changes file content, so it looks strange
we skip such the operations, when we are doing freeze_super().

Signed-off-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>
---
 drivers/block/loop.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 1e6edd568214..741e0a7bce41 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -434,7 +434,9 @@ static int lo_discard(struct loop_device *lo, struct request *rq, loff_t pos)
 		goto out;
 	}
 
+	file_start_write(file);
 	ret = file->f_op->fallocate(file, mode, pos, blk_rq_bytes(rq));
+	file_end_write(file);
 	if (unlikely(ret && ret != -EINVAL && ret != -EOPNOTSUPP))
 		ret = -EIO;
  out:




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux