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

write fails with EPERM, read succeeds



Hello,

This is a request for help to diagnose permission issue.

dd if=/dev/zero of=/dev/nbd2 bs=512 count=1
dd: error writing '/dev/nbd2': Operation not permitted

dd if=/dev/nbd2 of=/dev/zero bs=512 count=1
success

* strace shows that write() returns EPERM
* tcpdump shows no packets at all during this operation
(whereas I do see packets when starting and stopping the client)
* ioctl NBD_PRINT_DEBUG succeeds, wich suggests it's the
capability check in drivers/block/nbd.c that's failing
* same problem with a /dev/sda SSD SATA device
* I had this working fine a few days ago on virtually
identical setup, not sure what exactly changed.


nbd-client 3.16.2-2 on Arch Linux
nbd-server 3.16.2-1 on Debian Sid 4.13.7

On server:
nbd-server running as root via systemd service
/etc/nbd-server/config:
[generic]
includedir = /etc/nbd-server/conf.d

/etc/nbd-server/conf.d/dummy.conf:
[dummy]
	copyonwrite = false
	exportname = /dev/loop0
	authfile  /etc/nbd-server/bcdata.auth

/dev/loop0 is 0666, losetup /dev/loop0 /tmp/dummy.img (0777)
and the above dd command on server succeeds.

On client:
nbd-client runs as root via systemd service
/etc/nbdtab:
nbd2 servername dummy


Thank you.


Reply to: