D28780: [FstabWatcher] Fix loosing of fstab watcher

Stefan BrĂ¼ns noreply at phabricator.kde.org
Sun Apr 12 19:21:43 BST 2020


bruns created this revision.
bruns added a reviewer: Frameworks.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
bruns requested review of this revision.

REVISION SUMMARY
  In case the fstab is deleted (caused by editing it), the watch will be
  removed. The code already partially dealed with this, i.e. it tried to
  readd the watch, but did not check if the operation succeeded and dropped
  any further changes if not.
  
  Keep a watch on the containing folder and readd the fstab on change
  events. Unfortunately QFilesystemWatcher does not allow fine granular
  change events, though as /etc/ is likely mostly silent this should not
  matter much.
  
  The bug becomes apparent when e.g. editing the fstab with VIM, which
  has a quite broken implementation of creating temporary/backup files
  during save: it moves away the original file and creates the new file
  directly under the original name, instead of using a atomic rename.

TEST PLAN
  1. solid-hardware listen
  2. open fstab with vi, save a few times
  
  Without the change, solid will loose the watch sooner or later.
  
  Depends on D28779 <https://phabricator.kde.org/D28779>

REPOSITORY
  R245 Solid

BRANCH
  submit

REVISION DETAIL
  https://phabricator.kde.org/D28780

AFFECTED FILES
  src/solid/devices/backends/fstab/fstabwatcher.cpp
  src/solid/devices/backends/fstab/fstabwatcher.h

To: bruns, #frameworks
Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200412/467ff457/attachment.html>


More information about the Kde-frameworks-devel mailing list