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

This commit is contained in:
Harshavardhana 2019-10-08 15:50:43 -07:00 committed by kannappanr
parent 290ad0996f
commit d2a8be6fc2

View File

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