diff options
author | Tim Barron <tjbarron@google.com> | 2023-05-23 11:29:31 -0700 |
---|---|---|
committer | Tim Barron <tjbarron@google.com> | 2023-05-23 11:29:31 -0700 |
commit | 818e087b7b1108bc871bbe462d7d8fbf83d82d00 (patch) | |
tree | 34cf7b5a5684a14805700e12544c8396882fd983 | |
parent | c6fb6d8b39d551427707c337379b0c2e70459b9d (diff) | |
download | icing-818e087b7b1108bc871bbe462d7d8fbf83d82d00.tar.gz |
Update Icing from upstream.
Descriptions:
========================================================================
Downgrade log priorities on filesystem errors.
========================================================================
Bug: 282997030
Change-Id: Ia6dd9c9c1f3bdb68458cd1e9dba83e01a4b25123
-rw-r--r-- | icing/file/filesystem.cc | 18 | ||||
-rw-r--r-- | synced_AOSP_CL_number.txt | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/icing/file/filesystem.cc b/icing/file/filesystem.cc index c83a351..cd905e7 100644 --- a/icing/file/filesystem.cc +++ b/icing/file/filesystem.cc @@ -72,7 +72,7 @@ void LogOpenFileDescriptors() { << ") too large."; fd_lim = kMaxFileDescriptorsToStat; } - ICING_LOG(ERROR) << "Listing up to " << fd_lim << " file descriptors."; + ICING_LOG(INFO) << "Listing up to " << fd_lim << " file descriptors."; // Verify that /proc/self/fd is a directory. If not, procfs is not mounted or // inaccessible for some other reason. In that case, there's no point trying @@ -94,12 +94,12 @@ void LogOpenFileDescriptors() { if (len >= 0) { // Zero-terminate the buffer, because readlink() won't. target[len < target_size ? len : target_size - 1] = '\0'; - ICING_LOG(ERROR) << "fd " << fd << " -> \"" << target << "\""; + ICING_LOG(INFO) << "fd " << fd << " -> \"" << target << "\""; } else if (errno != ENOENT) { ICING_LOG(ERROR) << "fd " << fd << " -> ? (errno=" << errno << ")"; } } - ICING_LOG(ERROR) << "File descriptor list complete."; + ICING_LOG(INFO) << "File descriptor list complete."; } // Logs an error formatted as: desc1 + file_name + desc2 + strerror(errnum). @@ -108,7 +108,11 @@ void LogOpenFileDescriptors() { // file descriptors (see LogOpenFileDescriptors() above). void LogOpenError(const char* desc1, const char* file_name, const char* desc2, int errnum) { - ICING_LOG(ERROR) << desc1 << file_name << desc2 << strerror(errnum); + if (errnum == ENOENT) { + ICING_VLOG(1) << desc1 << file_name << desc2 << strerror(errnum); + } else { + ICING_LOG(ERROR) << desc1 << file_name << desc2 << strerror(errnum); + } if (errnum == EMFILE) { LogOpenFileDescriptors(); } @@ -361,7 +365,11 @@ int Filesystem::OpenForRead(const char* file_name) const { int64_t Filesystem::GetFileSize(int fd) const { struct stat st; if (fstat(fd, &st) < 0) { - ICING_LOG(ERROR) << "Unable to stat file: " << strerror(errno); + if (errno == ENOENT) { + ICING_VLOG(1) << "Unable to stat file: " << strerror(errno); + } else { + ICING_LOG(WARNING) << "Unable to stat file: " << strerror(errno); + } return kBadFileSize; } return st.st_size; diff --git a/synced_AOSP_CL_number.txt b/synced_AOSP_CL_number.txt index e53b3d1..bdf5f1b 100644 --- a/synced_AOSP_CL_number.txt +++ b/synced_AOSP_CL_number.txt @@ -1 +1 @@ -set(synced_AOSP_CL_number=533597029) +set(synced_AOSP_CL_number=534132257) |