[tracker-miners/wip/carlosg/fanotify-warnings] libtracker-miner: Avoid warning on EXDEV from fanotify_mark()




commit e096ef8b2381a8f17bd59a669acd865637ed28df
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 19 10:36:26 2022 +0200

    libtracker-miner: Avoid warning on EXDEV from fanotify_mark()
    
    This is sadly something that may happen with btrfs subvolumes, so
    will be seen frequently in certain environments, or might cause
    the test suite to fail for no (unforeseen) reason. Convert this
    errno into a g_info() what will not be logged by default.
    
    Closes: https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/212

 src/libtracker-miner/tracker-monitor-fanotify.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miner/tracker-monitor-fanotify.c b/src/libtracker-miner/tracker-monitor-fanotify.c
index 198b2e653..bb7da2b19 100644
--- a/src/libtracker-miner/tracker-monitor-fanotify.c
+++ b/src/libtracker-miner/tracker-monitor-fanotify.c
@@ -573,7 +573,11 @@ add_mark (TrackerMonitorFanotify *monitor,
                           FANOTIFY_EVENTS,
                           AT_FDCWD,
                           path) < 0) {
-               g_warning ("Could not add mark for path '%s': %m", path);
+               if (errno == EXDEV)
+                       g_info ("Could not set up cross-device mark for '%s': %m", path);
+               else
+                       g_warning ("Could not add mark for path '%s': %m", path);
+
                return FALSE;
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]