Bug 762774 (GLUSTER-1042) - Use correct flock structures in lk fops
Summary: Use correct flock structures in lk fops
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-1042
Product: GlusterFS
Classification: Community
Component: replicate
Version: mainline
Hardware: All
OS: Linux
urgent
medium
Target Milestone: ---
Assignee: Pavan Vilas Sondur
QA Contact:
URL:
Whiteboard:
: GLUSTER-1039 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-01 15:22 UTC by Pavan Vilas Sondur
Modified: 2015-12-01 16:45 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTP
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Pavan Vilas Sondur 2010-07-01 15:22:18 UTC
Currently, flock structures are not being used properly. Correct their usage, by separating out the user supplied flock with the 'returned' flock structure.

Test for fix:

Patch1

* For F_SETLK type calls (cmd == F_SETLK)
   - All servers get the same flock structure. (verify using 'option trace on' in the locks xlator on server(s))
   - Return flock does not matter.
* For F_SETLKW type calls (cmd == F_SETLKW)
   SAME AS ABOVE
* For F_UNLCK type calls (cmd == F_UNLCK)
   SAME AS ABOVE

* For F_GETLK type calls (cmd == F_GETLK)
  - All servers should get the same flock structure
  - The returned flock should be the flock structure, where the lk call was successful:
     * If all fail, returned flock does not matter
     * Partial failure: returned flock from any server where flock was successful.


Patch2

* Correct error messages in the log and failure of lk call (return value = -1 and errno = EINVAL) when flock is not filled properly:
  * Negative l_len values
  * Negative l_start values


Will attach 2 c programs to verify the above.

Comment 1 Anand Avati 2010-07-02 04:01:06 UTC
PATCH: http://patches.gluster.com/patch/3513 in release-3.0 (cluster/afr: Return correct flock structures correctly in lk fops.)

Comment 2 Anand Avati 2010-07-02 04:01:10 UTC
PATCH: http://patches.gluster.com/patch/3514 in release-3.0 (features/locks: Check flock structure before proceeding with the lk call.)

Comment 3 Anand Avati 2010-07-02 13:39:27 UTC
PATCH: http://patches.gluster.com/patch/3522 in release-3.0 (write-behind: fixes in flush)

Comment 4 Harshavardhana 2010-07-29 23:52:34 UTC
(In reply to comment #0)
> Currently, flock structures are not being used properly. Correct their usage,
> by separating out the user supplied flock with the 'returned' flock structure.
> 
> Test for fix:
> 
> Patch1
> 
> * For F_SETLK type calls (cmd == F_SETLK)
>    - All servers get the same flock structure. (verify using 'option trace on'
> in the locks xlator on server(s))
>    - Return flock does not matter.
> * For F_SETLKW type calls (cmd == F_SETLKW)
>    SAME AS ABOVE
> * For F_UNLCK type calls (cmd == F_UNLCK)
>    SAME AS ABOVE
> 
> * For F_GETLK type calls (cmd == F_GETLK)
>   - All servers should get the same flock structure
>   - The returned flock should be the flock structure, where the lk call was
> successful:
>      * If all fail, returned flock does not matter
>      * Partial failure: returned flock from any server where flock was
> successful.
> 
> 
> Patch2
> 
> * Correct error messages in the log and failure of lk call (return value = -1
> and errno = EINVAL) when flock is not filled properly:
>   * Negative l_len values
>   * Negative l_start values
> 
> 
> Will attach 2 c programs to verify the above.

where are the two "C" programs to be attached?

Comment 5 Anand Avati 2010-08-17 15:18:10 UTC
PATCH: http://patches.gluster.com/patch/4169 in master (cluster/afr: Return correct flock structures correctly in lk fops)

Comment 6 Vijay Bellur 2010-09-01 06:58:17 UTC
*** Bug 1039 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.