Hide Forgot
Description of problem: When running tests with use flocks and multiple processes the console can be flooded with messages like this: dlm: dev_write no op 2cb1031c a593 dlm: dev_write no op 2cb1031c a593 dlm: dev_write no op 2cb1031c a593 This message was added to catch problems with posix locks (fcntl). Version-Release number of selected component (if applicable): kernel-2.6.32-188.el6.x86_64 cman-3.0.12.1-10.el6.x86_64 How reproducible: Easily Steps to Reproduce: PATH=$PATH:/usr/tests/sts-rhel6.2/bin; xiogen -S 13481 -m random -o -t 1b -T 1000b -F 1000b:/mnt/gfs2/flockfile | xdoio -v -i 50 -K -n 2 Actual results: kernel messages are generated Expected results: no kernel messages are generated Additional info:
The bug is in dlm_controld.
Created attachment 518927 [details] the fix dlm_controld: fix plock dev_write no op When a plock unlock is received due to the file being closed (the CLOSE flag is set), we should not write an unlock result back to the kernel. If we do, the kernel, which does not expect a reply, will report the error "dev_write no op". In cases where dlm_controld encounters and error handling the unlock operation, it was writing the error result back to the kernel, even though the unlock was flagged with CLOSE. The fix is to check for the CLOSE flag and skip writing the error result, as we do with normal results. This problem is especially visible when using flocks (not plocks). This is because the kernel generates extraneous plock unlock requests when files are closed with flocks. Because dlm_controld finds no plocks on the files, it replies to the kernel with an error, rather than skipping the reply to do CLOSE.
There are two ways reproduce this problem and likewise verify it is fixed: (here using people.redhat.com/teigland/doflock.c) 1. close a file with an flock on it # touch /gfs/a # ./doflock /gfs/a 1 1 0 2000000 1 there should be no dev_write error 2. run two processes both opening/locking/unlocking/closing the same file # touch /gfs/a # ./doflock /gfs/a 1 1 1 10000 1000 & ./doflock /gfs/a 1 1 1 10000 1000 there should be no dev_write errors Both tests create the error message prior to the fix, and don't after the fix.
pushed to RHEL6 branch http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=95d90a01d89a610074a4817f1f2cbe67419a7654
For the record, I sent a patch upstream to eliminate the unnecessary posix unlocks when using flocks. I don't know if it will be accepted or not. http://marc.info/?l=linux-fsdevel&m=131377298029915&w=2
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: the patch for bug 678585 was incomplete. dlm_controld was still passing error results back to the kernel for posix unlock operations flagged with CLOSE. Consequence: the kernel complains if it receives a posix lock result that it is not expecting: "dev_write no op ...". Many of these can appear, especially when using flocks (not posix locks). Fix: dlm_controld is fixed to not pass error results to the kernel for posix unlock operations flagged with CLOSE. Result: No "dev_write no op" messages should appear.
Verified fixed using tests from Description comment, as well as both tests in comment #5. # uname -r; rpm -q cman 2.6.32-203.el6.x86_64 cman-3.0.12.1-23.el6.x86_64
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1516.html