Gentoo Archives: gentoo-user

From: tuxic@××××××.de
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] "Amount" of fstrim? (curiosity driven, no paranoia :)
Date: Mon, 27 Apr 2020 03:14:29
Message-Id: 20200427031418.l5qpkihcwgbn6eai@solfire
In Reply to: Re: [gentoo-user] "Amount" of fstrim? (curiosity driven, no paranoia :) by Rich Freeman
1 On 04/26 09:58, Rich Freeman wrote:
2 > On Sun, Apr 26, 2020 at 9:43 PM <tuxic@××××××.de> wrote:
3 > >
4 > > To implement a dry run with a printf() is new to me... ;)
5 > >
6 >
7 > That is all they fstrim authors could do, since there is no dry-run
8 > option for the actual ioctl, and fstrim itself has no idea how the
9 > filesystem will implement it (short of re-implementing numerous
10 > filesystems in the program and running it on unmounted devices). It
11 > seems like an fstrim dry-run is only minimally functional, though I
12 > guess it will test if you made any gross errors in syntax and so on.
13 > I don't see any reason why they couldn't have a dry-run option for the
14 > ioctl, but it would have to be implemented in the various filesystems.
15 > Really it seems like ioctl in general in the kernel isn't
16 > super-well-documented. It isn't like the system call interface. That
17 > is, unless I just missed some ioctl document floating around. The
18 > actual list of ioctls is in the kernel includes, but this does not
19 > define the syntax of the 3rd parameter of the ioctl system call which
20 > is function-specific. The structure used by the FITRIM ioctl is in the
21 > includes, but not with any kind of documentation or even a
22 > cross-reference to associate the structure with the ioctl itself.
23 >
24 > --
25 > Rich
26 >
27
28 Hi Rich,
29
30 thanks for the explanations again.
31 But I think it is better not to implement a feature at all as via
32 printf.
33
34 For a dry run I had expected, that some checks had been implemented,
35 whether a non-dry run would be successfull.
36
37 For example:
38 When submitting
39
40 fstrim -n /
41
42 as normal user I get:
43 /: 0 B (dry run) trimmed
44
45 Doing the same without dry run set I get:
46 fstrim: /: FITRIM ioctl failed: Operation not permitted
47
48 When doing a
49
50 fstrim -n /home/user
51
52 as normal user, I get the same behaviour as above --
53 despite that /home/user is on a harddisk with no
54 fstrim functionality at all.
55
56 If fstrim cannot implement the above correctlu, it would
57 be better not to implement it all...I think.
58
59 Cheers!
60 Meino

Replies

Subject Author
Re: [gentoo-user] "Amount" of fstrim? (curiosity driven, no paranoia :) William Kenworthy <billk@×××××××××.au>