Program: 113371
Project: 113371
Buggy source:
@Override public void startRequest(MRCRequest rq) throws Throwable {
  if (master.getReplMasterUUID() != null && !master.getReplMasterUUID().equals(master.getConfig().getUUID().toString()))   throw new DatabaseException(ExceptionType.REDIRECT);
  final mkdirRequest rqArgs=(mkdirRequest)rq.getRequestArgs();
  final VolumeManager vMan=master.getVolumeManager();
  final FileAccessManager faMan=master.getFileAccessManager();
  validateContext(rq);
  final Path p=new Path(rqArgs.getVolumeName(),rqArgs.getPath());
  final StorageManager sMan=vMan.getStorageManagerByName(p.getComp(0));
  final PathResolver res=new PathResolver(sMan,p);
  if (res.getParentDir() == null)   throw new UserException(POSIXErrno.POSIX_ERROR_EEXIST,"String_Node_Str" + res.getFileName() + "String_Node_Str");
  faMan.checkSearchPermission(sMan,res,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
  faMan.checkPermission(FileAccessManager.O_WRONLY,sMan,res.getParentDir(),res.getParentsParentId(),rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
  res.checkIfFileExistsAlready();
  AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
  long fileId=sMan.getNextFileId();
  int time=(int)(TimeSync.getGlobalTime() / 1000);
  sMan.createDir(fileId,res.getParentDirId(),res.getFileName(),time,time,time,rq.getDetails().userId,rq.getDetails().groupIds.get(0),rqArgs.getMode(),0,update);
  sMan.setLastFileId(fileId,update);
  MRCHelper.updateFileTimes(res.getParentsParentId(),res.getParentDir(),false,true,true,sMan,time,update);
  rq.setResponse(timestampResponse.newBuilder().setTimestampS(time).build());
  update.execute();
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq) throws Throwable {
  if (master.getReplMasterUUID() != null && !master.getReplMasterUUID().equals(master.getConfig().getUUID().toString()))   throw new DatabaseException(ExceptionType.REDIRECT);
  final mkdirRequest rqArgs=(mkdirRequest)rq.getRequestArgs();
  final VolumeManager vMan=master.getVolumeManager();
  final FileAccessManager faMan=master.getFileAccessManager();
  validateContext(rq);
  final Path p=new Path(rqArgs.getVolumeName(),rqArgs.getPath());
  final StorageManager sMan=vMan.getStorageManagerByName(p.getComp(0));
  final PathResolver res=new PathResolver(sMan,p);
  final FileMetadata parent=res.getParentDir();
  if (parent == null)   throw new UserException(POSIXErrno.POSIX_ERROR_EEXIST,"String_Node_Str" + res.getFileName() + "String_Node_Str");
  faMan.checkSearchPermission(sMan,res,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
  faMan.checkPermission(FileAccessManager.O_WRONLY,sMan,parent,parent.getId(),rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
  res.checkIfFileExistsAlready();
  String groupId=rq.getDetails().groupIds.get(0);
  int parentMode=faMan.getPosixAccessMode(sMan,parent,rq.getDetails().userId,rq.getDetails().groupIds);
  if ((parentMode & 02000) > 0) {
    groupId=parent.getOwningGroupId();
  }
  AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
  long fileId=sMan.getNextFileId();
  int time=(int)(TimeSync.getGlobalTime() / 1000);
  sMan.createDir(fileId,parent.getId(),res.getFileName(),time,time,time,rq.getDetails().userId,groupId,rqArgs.getMode(),0,update);
  sMan.setLastFileId(fileId,update);
  MRCHelper.updateFileTimes(parent.getId(),parent,false,true,true,sMan,time,update);
  rq.setResponse(timestampResponse.newBuilder().setTimestampS(time).build());
  update.execute();
}