chaos / 9nbd

network block device over 9P transport
21 stars 3 forks source link

9nbd does not properly report 9p transport errors #1

Open garlick opened 9 years ago

garlick commented 9 years ago

In debugging netroot and the nbd9 dracut module, we encountered a situation where the name of the export did not match the name of the mount path. 9P was returning error 2 (ENOENT), but 9nbd was reporting EPROTO.

This slowed us down finding the root cause. It would be better if 9nbd had reported the 9P transport error directly.

garlick commented 9 years ago

Example: file exported with privport option. The mount.diod --9nbd-attach without privport simply hangs, and console says:

[  540.872260] 9nbd0/ses17: 9P session restart due to protocol failure

While diod server (in debug mode) says:

diod: P9_TVERSION tag 65535 msize 65536 version '9P2000.L'
diod: P9_RVERSION tag 65535 msize 65536 version '9P2000.L'
diod: P9_TATTACH tag 1 fid 0 afid -1 uname '' aname '/tftpboot/images/image' n_uname 0
diod: attach(0@localhost:/tftpboot/images/image): access denied for export: Operation not permitted
diod: P9_RLERROR tag 1 ecode 1