diff --git a/src/fusedav.c b/src/fusedav.c index 82c0e91..fd48166 100644 --- a/src/fusedav.c +++ b/src/fusedav.c @@ -1396,14 +1396,9 @@ static int dav_mkdir(const char *path, mode_t mode) { } else { direntcnt = log_dirent_count(config->cache, parentpath); if(direntcnt > MAX_DIRENTS_IN_DIR) { - log_print(LOG_WARNING, SECTION_FUSEDAV_DIR, "dav_mkdir: %s; dirent count (%u) above threshold for %s", path, direntcnt, parentpath); - // TODO: This is currently just logging but not preventing the dav_mkdir operation. - // Once we are confident on the decision to go ahead with blocking the writes, - // uncomment/modify the code below to enforce it. - - // log_print(LOG_WARNING, SECTION_FUSEDAV_DIR, "dav_mkdir: %s aborted; dirent count (%u) above threshold for %s", path, direntcnt, parentpath); - // g_set_error(&gerr, fusedav_quark(), ENOSPC, "aborted; dirent count above threshold"); - // return processed_gerror("dav_mkdir: ", path, &gerr); + log_print(LOG_WARNING, SECTION_FUSEDAV_DIR, "dav_mkdir: %s aborted; dirent count (%u) above threshold for %s", path, direntcnt, parentpath); + g_set_error(&gerr, fusedav_quark(), ENOSPC, "aborted; dirent count above threshold"); + return processed_gerror("dav_mkdir: ", path, &gerr); } } free(parentpath); @@ -2170,14 +2165,9 @@ static int dav_create(const char *path, mode_t mode, struct fuse_file_info *info } else { direntcnt = log_dirent_count(config->cache, parentpath); if(direntcnt > MAX_DIRENTS_IN_DIR) { - log_print(LOG_WARNING, SECTION_FUSEDAV_FILE, "dav_create: %s; dirent count (%u) above threshold for %s", path, direntcnt, parentpath); - // TODO: This is currently just logging but not preventing the dav_create operation. - // Once we are confident on the decision to go ahead with blocking the writes, - // uncomment/modify the code below to enforce it. - - // log_print(LOG_WARNING, SECTION_FUSEDAV_FILE, "dav_create: %s aborted; dirent count (%u) above threshold for %s", path, direntcnt, parentpath); - // g_set_error(&gerr, fusedav_quark(), ENOSPC, "aborted; dirent count above threshold"); - // return processed_gerror("dav_create: ", path, &gerr); + log_print(LOG_WARNING, SECTION_FUSEDAV_FILE, "dav_create: %s aborted; dirent count (%u) above threshold for %s", path, direntcnt, parentpath); + g_set_error(&gerr, fusedav_quark(), ENOSPC, "aborted; dirent count above threshold"); + return processed_gerror("dav_create: ", path, &gerr); } } free(parentpath);