Re: [PATCH v2] loop: fix I/O error on fsync() in detached loop devices

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

 



On Thu, Jan 7, 2021 at 4:11 AM Ming Lei <ming.lei@xxxxxxxxxx> wrote:
[snip]
> OK, looks it is fine to disable writeback cache in __loop_clr_fd().
>
> BTW, just wondering why don't you disable WC unconditionally in
> __loop_clr_fd() or clear it in the following way because WC can be
> changed via sysfs?
>
>         if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
>                 blk_queue_write_cache(q, false, false);
>

Nice catch. Fixed that in v3.

That was actually a bug, where a read-only loop device (losetup -r)
that had write cache enabled via sysfs while attached, would not
disable it, since it was checking only for the read-only bits, thus
still suffering from the original issue.

Thanks,

> Thanks,
> Ming
>


-- 
Mauricio Faria de Oliveira



[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