The old code was using stat on the 'parent' directory to figure out the mode of the new directory. This will not work anymore with your patch, or am I missing something?