Fixed logic with flatten flag and flatten_file use with PLFS N-1 I/O.