patch-2.3.49 linux/fs/nfsd/nfs3xdr.c

Next file: linux/fs/nfsd/vfs.c
Previous file: linux/fs/nfsd/export.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.48/linux/fs/nfsd/nfs3xdr.c linux/fs/nfsd/nfs3xdr.c
@@ -181,7 +181,11 @@
 	} else {
 		p = xdr_encode_hyper(p, (u64) inode->i_size);
 	}
-	p = xdr_encode_hyper(p, ((u64)inode->i_blocks) << 9);
+	if (inode->i_blksize == 0 && inode->i_blocks == 0)
+		/* Minix file system(?) i_size is (hopefully) close enough */
+		p = xdr_encode_hyper(p, (u64)(inode->i_size +511)& ~511);
+	else
+		p = xdr_encode_hyper(p, ((u64)inode->i_blocks) << 9);
 	*p++ = htonl((u32) MAJOR(inode->i_rdev));
 	*p++ = htonl((u32) MINOR(inode->i_rdev));
 	p = xdr_encode_hyper(p, (u64) inode->i_dev);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)