As I said, we are trying fd read first, if failure, try to open the full_path and read again. If that open failed, calling lfn_open() again and try to read from that fd. Eventually, after all that still error in case of safe_read() , it is captured in the last if (got < 0) { check.