fix: reduce an extra readdir() attempted on non-legacy setups (#11301)

to verify moving content and preserving legacy content,
we have way to detect the objects through readdir()
this path is not necessary for most common cases on
newer setups, avoid readdir() to save multiple system
calls.

also fix the CheckFile behavior for most common
use case i.e without legacy format.
This commit is contained in:
Harshavardhana
2021-01-19 10:01:06 -08:00
committed by GitHub
parent e0055609bb
commit b5049d541f
2 changed files with 29 additions and 21 deletions

View File

@@ -1719,7 +1719,7 @@ func TestXLStorageCheckFile(t *testing.T) {
for i, testCase := range testCases {
if err := xlStorage.CheckFile(context.Background(), testCase.srcVol, testCase.srcPath); err != testCase.expectedErr {
t.Fatalf("TestXLStorage case %d: Expected: \"%s\", got: \"%s\"", i+1, testCase.expectedErr, err)
t.Errorf("TestXLStorage case %d: Expected: \"%s\", got: \"%s\"", i+1, testCase.expectedErr, err)
}
}
}