! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Extend device path to 128 characters
Status:
RESOLVED: FIXED
Product:
Xfce4-diskperf-plugin
Component:
General

Comments

Description Anonymous 2019-05-09 21:28:51 CEST
Created attachment 8502 
Diff of the change

This patch extends the device path length from 64 to 128 characters. This allows support for device paths like /dev/disk/by-id/ata-WDC_WD10EZEX-00UD2A0_WD-WMC3F0097994-558987441145878.
Comment 1 olaf 2019-05-15 21:33:21 CEST
Is 128 some upper limit? Shouldnt it be something like the max lenght of a directory entry?
Why are those constants used all over the place, instead of sizeof()?
If sizeof does not work, why not create a define?

So much bike shedding...
Comment 2 Git Bot editbugs 2019-05-16 21:49:19 CEST
Landry Breuil referenced this bugreport in commit 4db70a239601058e65859eabf8d8e524fa33d141

Allow for 128 chars device names (bug #15375)

https://git.xfce.org/panel-plugins/xfce4-diskperf-plugin/commit?id=4db70a239601058e65859eabf8d8e524fa33d141
Comment 3 Landry Breuil editbugs 2019-05-16 21:50:42 CEST
Bikeshedding without patches is not constructive, so i've just applied the provided patch :)
Comment 4 Anonymous 2019-05-25 13:50:41 CEST
128 characters is no upper limit but just some arbitrary value I choose by doubling the existing limit. It worked for my use case and the increase was small enough as to probably not cause any issues.
Using the "max lenght of a directory entry" will be quiet hard because, at least from my understanding, it heavily depends on the os and filesystem used. There are constants like PATH_MAX defined by POSIX, but it is discouraged to use them for memory allocation as their value can be undefined, arbitrarily high or even infinite.
I do agree that it would be a good idea to reduce the number of constant values in favour of sizeof() or a self-defined constant. My lack of experience in hacking xfce (as well as c and gtk in general) however prevented me from confidently making such a change. So I was happy enough to get the desired result with changing a few numbers here and there.

Bug #15375

Reported by:
Anonymous
Reported on: 2019-05-09
Last modified on: 2019-05-25

People

Assignee:
Xfce-Goodies Maintainers
CC List:
2 users

Version

Attachments

Diff of the change (1.75 KB, patch)
2019-05-09 21:28 CEST , Anonymous
no flags

Additional information