Cherry picking changes from msdosfs branch