Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
python-libmount.12160
util-linux-fstrim-RO.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-fstrim-RO.patch of Package python-libmount.12160
From 2d22ac64e4d6e6732640f38b7232b5bcdc84a877 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec <sbrabec@suse.cz> Date: Mon, 10 Jun 2019 21:59:45 +0200 Subject: [PATCH] fstrim -a/-A: Skip read-only volumes Calling TRIM on some read-only volumes can fail with: fstrim: /win: FITRIM ioctl failed: Bad file descriptor Skipping all read-only mounts seems to be safe and logical strategy. Fixes opensuse#1106214. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> --- sys-utils/fstrim.c | 8 ++++++++ 1 file changed, 8 insertions(+) Index: util-linux-2.31.1/sys-utils/fstrim.c =================================================================== --- util-linux-2.31.1.orig/sys-utils/fstrim.c +++ util-linux-2.31.1/sys-utils/fstrim.c @@ -216,6 +216,14 @@ static int fstrim_all(struct fstrim_rang if (rc) continue; /* overlaying mount */ + /* FSTRIM on read-only filesystem can fail, and it can fail */ + if (access(path, W_OK) != 0) { + if (errno == EROFS) + continue; + if (errno == EACCES) + continue; + } + if (!has_discard(src, &wholedisk)) continue; cnt++;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor