-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chimera: fix race condition on remove
the remove operation does a three steps: 1. remove entry in a directory 2. decrease files nlink count 3. decrease prent directory nlink count If two threads do the same operation in the very same moment, then step (3) done twice, while step (1) effectively happens only once. This patch introduces a check for result of step (1) and does not proceeds if file is already removed. Observer at DESY on cloud instance, where two cloud servers was running a cron job, which happens to run the same create->remove cycle at very same moment. The procedure to fix invalid nlink count: UPDATE t_inodes SET inlink = ( SELECT COUNT(*) FROM t_dirs WHERE t_inodes.ipnfsid = t_dirs.iparent ) WHERE itype = 16384; Acked-by: Paul Millar Target: master >>> 2.6 Require-book: no Require-notes: yes (cherry picked from commit fb33e16) Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
- Loading branch information
Showing
1 changed file
with
29 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters