> + error = bmap(inode, (sector_t *)&block); You can't cast and int * to a sector_t * without causing problems. You'll need a local variable of type sector_t that the value gets assigned to and read back from instead. Also shouldn't this patch be earlier in the series?