Blame bcache-status-rootgc.patch
|
Rolf Fokkens |
8189001 |
--- bcache-tools-1.0.8.bcache-status.orig 2016-08-04 15:03:50.095602401 +0200
|
|
Rolf Fokkens |
8189001 |
+++ bcache-tools-1.0.8/bcache-status 2016-08-04 14:31:24.507542579 +0200
|
|
Rolf Fokkens |
8189001 |
@@ -337,8 +337,12 @@
|
|
Rolf Fokkens |
8189001 |
continue
|
|
Rolf Fokkens |
8189001 |
|
|
Rolf Fokkens |
8189001 |
if run_gc:
|
|
Rolf Fokkens |
8189001 |
- with open('%s%s/internal/trigger_gc' % (SYSFS_BCACHE_PATH, cache), 'w') as fd:
|
|
Rolf Fokkens |
8189001 |
- fd.write('1\n')
|
|
Rolf Fokkens |
8189001 |
+ try:
|
|
Rolf Fokkens |
8189001 |
+ with open('%s%s/internal/trigger_gc' % (SYSFS_BCACHE_PATH, cache), 'w') as fd:
|
|
Rolf Fokkens |
8189001 |
+ fd.write('1\n')
|
|
Rolf Fokkens |
8189001 |
+ except PermissionError as e:
|
|
Rolf Fokkens |
8189001 |
+ print ('You need root permissions for the --gc option')
|
|
Rolf Fokkens |
8189001 |
+ sys.exit(1)
|
|
Rolf Fokkens |
8189001 |
|
|
Rolf Fokkens |
8189001 |
dump_bcache('%s%s' % (SYSFS_BCACHE_PATH, cache), stats, print_subdevices, uuid_map.get(cache, '?'))
|
|
Rolf Fokkens |
8189001 |
|