Program: 113699
Project: 113699
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    final linkRequest rqArgs=(linkRequest)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    final FileAccessManager faMan=master.getFileAccessManager();
    validateContext(rq);
    final Path lp=new Path(rqArgs.getLink_path());
    final Path tp=new Path(rqArgs.getTarget_path());
    if (!lp.getComp(0).equals(tp.getComp(0)))     throw new UserException(ErrNo.EXDEV,"String_Node_Str");
    final VolumeInfo volume=vMan.getVolumeByName(lp.getComp(0));
    final StorageManager sMan=vMan.getStorageManager(volume.getId());
    final PathResolver lRes=new PathResolver(sMan,lp);
    final PathResolver tRes=new PathResolver(sMan,tp);
    faMan.checkSearchPermission(sMan,lRes,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    faMan.checkPermission(FileAccessManager.O_WRONLY,sMan,lRes.getParentDir(),0,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    lRes.checkIfFileExistsAlready();
    faMan.checkSearchPermission(sMan,tRes,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    tRes.checkIfFileDoesNotExist();
    FileMetadata target=tRes.getFile();
    if (target.isDirectory())     throw new UserException(ErrNo.EPERM,"String_Node_Str");
    faMan.checkPermission(FileAccessManager.O_WRONLY,sMan,target,tRes.getParentDirId(),rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
    sMan.link(target,lRes.getParentDirId(),lRes.getFileName(),update);
    MRCHelper.updateFileTimes(lRes.getParentsParentId(),lRes.getParentDir(),false,true,true,sMan,update);
    MRCHelper.updateFileTimes(tRes.getParentDirId(),target,false,true,false,sMan,update);
    rq.setResponse(new linkResponse());
    update.execute();
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq){
  try {
    final linkRequest rqArgs=(linkRequest)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    final FileAccessManager faMan=master.getFileAccessManager();
    validateContext(rq);
    final Path lp=new Path(rqArgs.getLink_path());
    final Path tp=new Path(rqArgs.getTarget_path());
    if (!lp.getComp(0).equals(tp.getComp(0)))     throw new UserException(ErrNo.EXDEV,"String_Node_Str");
    final VolumeInfo volume=vMan.getVolumeByName(lp.getComp(0));
    final StorageManager sMan=vMan.getStorageManager(volume.getId());
    final PathResolver lRes=new PathResolver(sMan,lp);
    final PathResolver tRes=new PathResolver(sMan,tp);
    faMan.checkSearchPermission(sMan,lRes,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    faMan.checkPermission(FileAccessManager.O_WRONLY,sMan,lRes.getParentDir(),0,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    lRes.checkIfFileExistsAlready();
    faMan.checkSearchPermission(sMan,tRes,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    tRes.checkIfFileDoesNotExist();
    FileMetadata target=tRes.getFile();
    if (target.isDirectory())     throw new UserException(ErrNo.EPERM,"String_Node_Str");
    faMan.checkPermission(FileAccessManager.O_WRONLY,sMan,target,tRes.getParentDirId(),rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
    sMan.link(target,lRes.getParentDirId(),lRes.getFileName(),update);
    MRCHelper.updateFileTimes(lRes.getParentsParentId(),lRes.getParentDir(),false,true,true,sMan,update);
    MRCHelper.updateFileTimes(tRes.getParentDirId(),target,false,true,false,sMan,update);
    rq.setResponse(new linkResponse());
    update.execute();
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}