parentDirIsObject() to return quickly with inexistant parent (#11204)
Rewrite parentIsObject() function. Currently if a client uploads a/b/c/d, we always check if c, b, a are actual objects or not. The new code will check with the reverse order and quickly quit if the segment doesn't exist. So if a, b, c in 'a/b/c' does not exist in the first place, then returns false quickly.
This commit is contained in:
@@ -1596,14 +1596,14 @@ func TestXLStorageCheckFile(t *testing.T) {
|
||||
{
|
||||
srcVol: "success-vol",
|
||||
srcPath: "nonexistent-file",
|
||||
expectedErr: errFileNotFound,
|
||||
expectedErr: errPathNotFound,
|
||||
},
|
||||
// TestXLStorage case - 4.
|
||||
// TestXLStorage case with non-existent file path.
|
||||
{
|
||||
srcVol: "success-vol",
|
||||
srcPath: "path/2/success-file",
|
||||
expectedErr: errFileNotFound,
|
||||
expectedErr: errPathNotFound,
|
||||
},
|
||||
// TestXLStorage case - 5.
|
||||
// TestXLStorage case with path being a directory.
|
||||
@@ -1617,7 +1617,7 @@ func TestXLStorageCheckFile(t *testing.T) {
|
||||
{
|
||||
srcVol: "non-existent-vol",
|
||||
srcPath: "success-file",
|
||||
expectedErr: errVolumeNotFound,
|
||||
expectedErr: errPathNotFound,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user