[PATCH] nbd in 2.5.3 does not work, and can cause severe damage when read-write
Hi Linus, I've got strange idea and tried to build diskless machine around 2.5.3... Besides problem with segfaulting crc32 (it is initialized after net/ipv4/ipconfig.c due to lib/lib.a being a library... I had to hardcode lib/crc32.o before --start-group in main Makefile, but it is another story) there is bad problem with NBD caused by BIO changes: (1) request flags were immediately put into on-wire request format. In the past, we had 0=READ, !0=WRITE. Now only REQ_RW bit determines direction. As nbd-server from nbd distribution package treats any non-zero value as write, it performs writes instead of read. Fortunately it will die due to other consistency checks on incoming request, but... (2) nbd servers handle only up to 10240 byte requests. So setting max_sectors to 20 is needed, as otherwise nbd server commits suicide. Maximum request size should be handshaked during nbd initialization, but currently just use hardwired 20 sectors, so it will behave like it did in the past.
Showing
Please register or sign in to comment