Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/minidlna: Ignore sparseness check to make 'rescan' work #1470

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ports/net/minidlna/dragonfly/patch-monitor.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- monitor.c.orig 2023-05-31 08:25:59 UTC
+++ monitor.c
@@ -355,7 +355,17 @@ monitor_insert_directory(int fd, char *n
{
monitor_insert_directory(fd, esc_name, path_buf);
}
- else if( type == TYPE_FILE && check_notsparse(path_buf)) {
+ else if( type == TYPE_FILE && access(path_buf, R_OK) == 0) {
+ /*
+ * Ignore the sparseness check on DragonFly to make the
+ * rescanning work. Although SEEK_HOLE is declared,
+ * it's not implemented in lseek(2). In addition, the
+ * sparseness check by block count is broken for
+ * filesystems with compression or deduplication, such
+ * as HAMMER2. Therefore, just disable the sparseness
+ * check here and ignore the potential issues of Samba
+ * client dealing with sparse files.
+ */
monitor_insert_file(esc_name, path_buf);
}
free(esc_name);
Loading