Re: [RFC PATCH] target: detect read-only from underlying iblock device

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

 



On Tue, 2017-12-05 at 21:54 +0100, David Disseldorp wrote:
> A read-only block device must currently be flagged as such when
> configuring the iblock backstore, via a readonly=1 configfs parameter.
> If a read-only block device is used without explicitly providing the
> parameter, then backstore enablement fails with EACCES, e.g.
>   losetup --read-only /dev/loop0 /lofile
>   mkdir -p /sys/kernel/config/target/core/iblock_0/loopy
>   echo "udev_path=/dev/loop0" \
> 	> /sys/kernel/config/target/core/iblock_0/loopy/control
>   echo "1" > /sys/kernel/config/target/core/iblock_0/loopy/enable
>   sh: echo: write error: Permission denied
> 
> This change allows an iblock backstore to be demoted to read-only if the
> underlying device is detected as such, via a -EACCES return value from
> blkdev_get_by_path(udev_path=$readonly_device, mode & FMODE_WRITE, ...).

Hello David,

Although the patch itself looks fine to me: do we really need this kind of
functionality in the kernel? Is it possible to implement the same functionality
in user space?

Thanks,

Bart.��.n��������+%������w��{.n����j�����{ay�ʇڙ���f���h������_�(�階�ݢj"��������G����?���&��




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux