enh: check failure of tfsMkdirRecurAt
This commit is contained in:
parent
60eec06507
commit
ddaba463c0
|
@ -562,7 +562,8 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
|
|||
code = terrno;
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
}
|
||||
tfsMkdirRecurAt(pTsdb->pVnode->pTfs, pTsdb->path, did);
|
||||
code = tfsMkdirRecurAt(pTsdb->pVnode->pTfs, pTsdb->path, did);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
wSet.diskId = did;
|
||||
wSet.nSttF = 1;
|
||||
}
|
||||
|
|
|
@ -891,8 +891,10 @@ static int32_t tsdbSnapWriteFileDataStart(STsdbSnapWriter* pWriter, int32_t fid)
|
|||
if (pSet) {
|
||||
diskId = pSet->diskId;
|
||||
} else {
|
||||
tfsAllocDisk(pTsdb->pVnode->pTfs, 0 /*TODO*/, &diskId);
|
||||
tfsMkdirRecurAt(pTsdb->pVnode->pTfs, pTsdb->path, diskId);
|
||||
code = tfsAllocDisk(pTsdb->pVnode->pTfs, 0 /*TODO*/, &diskId);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
code = tfsMkdirRecurAt(pTsdb->pVnode->pTfs, pTsdb->path, diskId);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
}
|
||||
SDFileSet wSet = {.diskId = diskId,
|
||||
.fid = fid,
|
||||
|
|
|
@ -227,6 +227,9 @@ int32_t tfsMkdirAt(STfs *pTfs, const char *rname, SDiskID diskId) {
|
|||
STfsDisk *pDisk = TFS_DISK_AT(pTfs, diskId);
|
||||
char aname[TMPNAME_LEN];
|
||||
|
||||
if (pDisk == NULL) {
|
||||
return -1;
|
||||
}
|
||||
snprintf(aname, TMPNAME_LEN, "%s%s%s", pDisk->path, TD_DIRSEP, rname);
|
||||
if (taosMkDir(aname) != 0) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
|
|
Loading…
Reference in New Issue