do_pwrite unalign continued. Also fix the dirty extent bug.