Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-5913

Nfs3Utils#getWccAttr() should check attr parameter against null

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.0
    • Component/s: nfs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In RpcProgramNfs3#commit() :

            Nfs3FileAttributes postOpAttr = null;
            try {
              postOpAttr = writeManager.getFileAttr(dfsClient, handle, iug);
            } catch (IOException e1) {
              LOG.info("Can't get postOpAttr for fileId: " + handle.getFileId());
            }
            WccData fileWcc = new WccData(Nfs3Utils.getWccAttr(preOpAttr), postOpAttr);
      

      If there is exception, postOpAttr would be null.
      However, Nfs3Utils#getWccAttr() dereferences attr parameter directly.

        Attachments

        1. HDFS-5913.patch
          1.0 kB
          Brandon Li

          Activity

            People

            • Assignee:
              brandonli Brandon Li
              Reporter:
              yuzhihong@gmail.com Ted Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: