pojntfx / go-nbd

Pure Go NBD server and client library.
Apache License 2.0
346 stars 18 forks source link

Size return 0 with standard blockDevices in FileBackend which leads to mount error on client side #8

Closed efrasyab closed 2 months ago

efrasyab commented 9 months ago

if Size() function of the FileBackend would be revised as below, standard block devices could be mounted successfully from client side.

func (b *FileBackend) Size() (int64, error) { stat, err := b.file.Seek(0,2) if err != nil { return -1, err } return stat, nil }

pojntfx commented 2 months ago

Thank you! Implemented in 2d78be2564f3835178508cb61c0a84d562f80364