提交 ddaba463 编写于 作者: B Benguang Zhao

enh: check failure of tfsMkdirRecurAt

上级 60eec065
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册