aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-03-08Version 0.10.10HEADv0.10.10masterDavid Howells2-2/+5
Signed-off-by: David Howells <dhowells@redhat.com>
2017-02-24Don't use readdir_rDavid Howells1-39/+46
Don't use readdir_r() as it is obsolete. Use readdir() instead. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com>
2016-02-17Makefile: Put things in a cachefilesd directory when making a tarballv0.10.9David Howells2-2/+5
Fix the Makefile to put things in a cachefilesd directory when making a tarball, not in a directory called 'keyutils'. Signed-off-by: David Howells <dhowells@redhat.com>
2016-02-17Enable PIE and RELRO for RPM buildsDavid Howells1-9/+4
Turn on PIE and RELRO build hardening for RPM builds. Signed-off-by: David Howells <dhowells@redhat.com>
2016-02-17Fix the cachefilesd.service file to point to /usr/sbin/cachefilesdDavid Howells2-1/+2
Fix the cachefilesd.service file to point to /usr/sbin/cachefilesd rather than /sbin/cachefilesd. Signed-off-by: David Howells <dhowells@redhat.com>
2016-02-17SPEC: Use systemd installation interaction macrosDavid Howells1-15/+7
Use the systemd interaction macros in the pre/post-installation and pre/post-uninstallation sections rather than open-coding the interaction. Signed-off-by: David Howells <dhowells@redhat.com>
2016-02-04Version 0.10.7v0.10.7nextDavid Howells2-2/+5
Signed-off-by: David Howells <dhowells@redhat.com>
2016-02-03Clear the supplementary groups list when daemonisingDavid Howells1-0/+6
Clear the supplementary groups list when daemonising the process. This fixes the following issue raised by rpmlint: cachefilesd.x86_64: E: missing-call-to-setgroups-before-setuid /usr/sbin/cachefilesd Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2016-02-03Version 0.10.6v0.10.6David Howells2-2/+8
Signed-off-by: David Howells <dhowells@redhat.com>
2016-02-03Suspend/resume culling based on recently released file/block countsnext-cullDavid Howells3-79/+223
Newer kernels include the counts of objects and blocks unpinned since last the status was read over the control device fd. The unpinning is usually through relinquishment by the netfs. If these fields are present, extract them and use them to work out whether there can be anything to cull. The fields are reset when read and POLLIN is signalled when the file counter is increased from 0. If there is nothing new to cull, scanning to build a cull table is suspended until more stuff is available. If the new fields are present, work on that basis - otherwise we sleep for 30s and try again. The thresholds at which culling should be resumed can be set by adding: resume_thresholds <block> <file> to the config file. The cull scan is retried when sufficient cumulative unpinning has happened that either threshold is exceeded. The block threshold watches the cumulative i_blocks for unpinned cache inodes and the file threshold watches the number of cache inodes unpinned. If either is "-" then that threshold is disabled. The default is 5 files and no block threshold. Further: (*) Some of the variable names are changed to be more obvious as to what they do. (*) If time-based culling is used, then SIGALRM must be blocked between the did-it-happen check and the call to poll. SIGINT, SIGTERM and SIGIO are already so blocked. (*) All the decision making logic is moved into the cachefilesd() function rather than being spread out. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Steve Dickson <steved@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2016-01-25cachefilesd can spin when disk space is short.NeilBrown1-3/+6
When cachefilesd finds that it needs to cull, but that culling doesn't achieve anything, it sets an alarm to wake it in 30 seconds to try again. But as read_cache_state() will detect that culling is still needed, it will immediately try again anyway. This results in 100% cpu usage of no value. This patch causes culling to be blocked until the 30 second alarm goes off. It also changes the test to decide whether to enter poll() after blocking signals to test exactly those values that might be changed by a signal. Testing these is important, testing anything else is pointless. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Steve Dickson <steved@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2016-01-25Add -Wsign-compare to the buildDavid Howells2-63/+60
Add -Wsign-compare to the build as comparisons between a negative signed int and a positive unsigned int don't compare as expected. Fix up the comparisons then flagged. This includes moving to zero-based indices for the cull tables. Signed-off-by: David Howells <dhowells@redhat.com>
2016-01-25Permit culling to be disabled on the command lineDavid Howells3-3/+15
Permit culling to be disabled on the command line by passing a -N flag. Signed-off-by: David Howells <dhowells@redhat.com>
2016-01-21Apply some cleanups to cachefilesdDavid Howells1-32/+36
Apply some cleanups to cachefilesd: (1) Use bool rather than int where appropriate. (2) Don't explicitly initialise static variables to 0 otherwise they'll end up in .data rather than .bss and use file space. Signed-off-by: David Howells <dhowells@redhat.com>
2016-01-21spec: Do some specfile cleanupsDavid Howells1-9/+1
(*) Don't set, create or destroy the buildroot. (*) Use %global rather than %define where possible. (*) Automatically create the doc directory and move stuff into it using the %doc file macro. (*) Don't set a %defattr. Signed-off-by: David Howells <dhowells@redhat.com>
2016-01-21The documentation directory is now unversionedDavid Howells4-8/+8
The directory in which the documentation is stored now has no version included in its name, so remove this from all references to it. Signed-off-by: David Howells <dhowells@redhat.com>
2016-01-21SELinux: The cachefilesd-selinux rpm no longer existsDavid Howells1-3/+6
The cachefilesd-selinux RPM no longer exists as its policy has been merged into the master policy RPM, so scrub the references to it. Signed-off-by: David Howells <dhowells@redhat.com>
2016-01-20Fix Makefile to produce compressed tarballsDavid Howells1-5/+9
The Makefile should be producing compressed tarballs under the name cachefilesd-<version>.tar.bz2 not uncompressed tarballs. Fix that. Signed-off-by: David Howells <dhowells@redhat.com>
2016-01-20spec: The licence is actually GPLv2+David Howells1-1/+1
The licence is actually GPLv2+ so put that in the specfile. Signed-off-by: David Howells <dhowells@redhat.com>
2015-03-02Fixing null reference for malformed kernel status output.John Snow1-1/+5
In certain cases, a NULL may be passed along to string library functions. Not anymore! Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
2015-03-02Updating .gitignore.John Snow1-0/+3
Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
2015-02-26The rpmbuild %dist macro moved so look for it more broadlyDavid Howells1-1/+1
The rpmbuild %dist macro moved from /etc/rpm/macros.dist so look for it more broadly (it's now in /usr/lib/rpm/macros.d/macros.dist). Signed-off-by: David Howells <dhowells@redhat.com>
2014-02-25Fix specfile errorsDavid Howells2-13/+23
Fix specfile errors found by rpmlint including: (1) Bad dates in the changelog. (2) An uninstalled file. Signed-off-by: David Howells <dhowells@redhat.com>
2011-12-06Version 0.10.5v0.10.5David Howells1-2/+2
2011-12-06Apply systemd review commentsDavid Howells2-2/+5
"-qab" should be passed to the modprobe in the systemd service file that loads the cachefiles.ko kernel module. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=754811 Reported-by: Jóhann B. Guðmundsson <johannbg@johannbg@hi.is> Signed-off-by: David Howells <dhowells@redhat.com>
2011-12-06Use Fedora CFLAGS in build (fixes build on s390).Dan Horák1-1/+4
Signed-off-by: Dan Horák <dan@danny.cz> Signed-off-by: David Howells <dhowells@redhat.com>
2011-11-30Bump the revision to 0.10.4v0.10.4David Howells1-2/+2
2011-11-30Fix rpmlint complaintsDavid Howells3-18/+24
Provide a makefile rule to run rpmlint on the RPMs it has built. Fix the complaints made by rpmlint. Signed-off-by: David Howells <dhowells@redhat.com>
2011-11-30Fix the specfile to require the bits for the _unitdir macro during the buildDavid Howells1-0/+4
Fix the specfile to require the bits for the _unitdir macro during the build of an RPM as specified in: https://fedoraproject.org/wiki/Packaging:Guidelines:Systemd Signed-off-by: David Howells <dhowells@redhat.com>
2011-11-30Bump the revision to 0.10.3v0.10.3David Howells1-5/+5
2011-11-30Move to native systemd supportDavid Howells3-18/+32
Replace the old init script with a native systemd service definition. Signed-off-by: David Howells <dhowells@redhat.com>
2011-11-30Build: Provide rules to build tarballs and RPMsDavid Howells2-5/+83
Provide make rules to build tarballs (make tarball) and RPMs (make rpm) from the GIT tree. The local build ID can be set whilst building an RPM: make rpm BUILDID=.foo This is incorporated into the RPM names after the release number. Signed-off-by: David Howells <dhowells@redhat.com>
2011-07-18Bump the revision to 0.10.2v0.10.2-signedv0.10.2David Howells2-2/+2
2011-07-15Change the culling info messages to debug levelDavid Howells2-3/+6
Change the culling info messages to debug level so as not to fill up the disk space with logs. Signed-off-by: David Howells <dhowells@redhat.com>
2011-07-15Fix the cachefilesd initscriptDavid Howells2-58/+97
Fix the cachefilesd initscript to: (1) embed a parseable description for init to use, and (2) use the appropriate exit codes. For more information, see: https://fedoraproject.org/wiki/Packaging/SysVInitScript Signed-off-by: David Howells <dhowells@redhat.com>
2010-04-28SELinux: Fix the RPM Requires dependency on selinux-policy-baseDavid Howells1-1/+4
Fix the RPM Requires dependency on selinux-policy-base to be >=, not =. Signed-off-by: David Howells <dhowells@redhat.com>
2010-04-26Bump the revision to 0.10.1v0.10.1David Howells2-2/+2
2010-04-26Tone down cachefiled's system log verbositySteve Dickson1-2/+2
There is no need to log every time the cull table is refilled. Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
2010-04-26SELinux: Fix a wildchar that should be a dot in a filename in the policyDavid Howells2-1/+2
Fix a wildchar that should be a dot in a filename in the policy. Signed-off-by: David Howells <dhowells@redhat.com>
2010-04-26SELinux: Make the initscript to a restorecon on various filesDavid Howells2-1/+9
Make the initscript to a restorecon on various files to make sure they have the right security context. Signed-off-by: David Howells <dhowells@redhat.com>
2010-04-26Move the default cache location to /var/cache/fscacheDavid Howells7-23/+26
Move the default cache location to /var/cache/fscache to be consistent with other packages that have caches. Signed-off-by: David Howells <dhowells@redhat.com>
2010-04-23SELinux: The SELinux policy is now in the selinux-policy-* RPMsDavid Howells2-77/+14
The SELinux policy is now in the selinux-policy package and so doesn't need to be here. Signed-off-by: David Howells <dhowells@redhat.com>
2010-03-25SELinux: Allow cachefilesd to use rmdir on directories in the cacheDavid Howells1-1/+1
Amend the SELinux policy to allow cachefilesd to use rmdir on directories in the cache. Without this, messages like the following: node=barsoom.rdu.redhat.com type=AVC msg=audit(1269518332.550:21841): avc: denied { rmdir } for pid=1670 comm="cachefilesd" name="@b5" dev=dm-0 ino=1177664 scontext=unconfined_u:system_r:cachefilesd_t:s0 tcontext=system_u:object_r:cachefiles_var_t:s0 tclass=dir in the audit log. Signed-off-by: David Howells <dhowells@redhat.com>
2010-02-26Bump the minor version to 0.10v0.10David Howells2-4/+22
Signed-off-by: David Howells <dhowells@redhat.com>
2010-02-26Provide an option to suppress cachefilesd cullingDavid Howells2-25/+45
Provide an option to suppress cachefilesd culling. This prevents the daemon from using up resources scanning the cache. The downside is that it never attempts to shrink the cache to make space when the cache ends up exceeding its limits due to other processes using up resources on the same filesystem as the cache. Signed-off-by: David Howells <dhowells@redhat.com>
2010-02-25Document the 'secctx' optionDavid Howells1-6/+21
Signed-off-by: David Howells <dhowells@redhat.com>
2010-02-25Update the SELinux policy for cachefilesdDavid Howells4-36/+74
Signed-off-by: David Howells <dhowells@redhat.com>
2010-02-25Remove tail comments on closing function bracesDavid Howells2-42/+22
Signed-off-by: David Howells <dhowells@redhat.com>
2010-02-25Must #include <sys/stat.h> before using stat() and coDavid Howells2-0/+4
cachefilesd.c should #include <sys/stat.h> if it's going to use stat() and related functions [RH BZ 565135]. Signed-off-by: David Howells <dhowells@redhat.com>
2010-02-23Have GIT ignore built binariesDavid Howells1-0/+1
2010-02-22cachefilesd historical revision 0.9v0.9David Howells2-27/+47
The cachefiles module no longer accepts directory fds on cull and inuse commands, but rather uses current working directory. Use stat64/fstatat64 to avoid EOVERFLOW errors from the kernel on large files.
2010-02-22cachefilesd historical revision 0.8v0.8David Howells12-87/+663
Made cachefilesd ask the kernel whether cullable objects are in use and omit them from the cull table if they are. Made the size of cachefilesd's culling tables configurable. Updated the manual pages. Documented SELinux interaction. Include SELinux policy for cachefilesd. Fixed typo that was causing the howto.txt not to be installed. Use /dev/cachefiles if it present in preference to /proc/fs/cachefiles. Use poll rather than SIGURG on /dev/cachefilesd.
2010-02-22cachefilesd historical revision 0.7v0.7David Howells3-4/+273
Add a how-to document. Don't need to predeclare functions with printf attributes - it can be done on the definition as long as the attribute goes first.
2010-02-22cachefilesd historical revision 0.6v0.6David Howells5-40/+89
Mark __error() as attribute format printf Fix up format errors shown up
2010-02-22cachefilesd historical revision 0.5v0.5David Howells3-21/+69
Rerun the scan after a deferral period if the cache is empty for initial scan Updated init.d script to look for cachefilesd in /sbin Added postun and preun rules so cachefilesd is stopped and started when the rpm is updated or removed. Require /sbin/chkconfig not /usr/bin/chkconfig
2010-02-22cachefilesd historical version 0.4v0.4David Howells8-0/+2037