gateway/hdfs: Fix isObjectDir to behave correctly (#8368)

master
Harshavardhana 5 years ago committed by kannappanr
parent 290ad0996f
commit d2a8be6fc2
  1. 3
      cmd/gateway/hdfs/gateway-hdfs.go

@ -509,10 +509,11 @@ func (n *hdfsObjects) isObjectDir(ctx context.Context, bucket, object string) bo
} }
defer f.Close() defer f.Close()
fis, err := f.Readdir(1) fis, err := f.Readdir(1)
if err != nil { if err != nil && err != io.EOF {
logger.LogIf(ctx, err) logger.LogIf(ctx, err)
return false return false
} }
// Readdir returns an io.EOF when len(fis) == 0.
return len(fis) == 0 return len(fis) == 0
} }

Loading…
Cancel
Save