ZanderXu opened a new pull request, #4987:
URL: https://github.com/apache/hadoop/pull/4987

   ### Description of PR
   
   During looking into some code related XATTR, I found there is a bug in 
SerialNumberMap, as bellow:
   ```
   public int get(T t) {
     if (t == null) {
       return 0;
     }
     Integer sn = t2i.get(t);
     if (sn == null) {
       sn = current.getAndIncrement();
       if (sn > max) {
         current.getAndDecrement();
         throw new IllegalStateException(name + ": serial number map is full");
       }
       Integer old = t2i.putIfAbsent(t, sn);
       if (old != null) {
         // here: if the old is not null, we should decrease the current value.
         return old;
       }
       i2t.put(sn, t);
     }
     return sn;
   } 
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to