Bug 253737 - CIFS: bad test for unlocking when posix extensions are disabled
Summary: CIFS: bad test for unlocking when posix extensions are disabled
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jeff Layton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-08-21 16:58 UTC by Jeff Layton
Modified: 2007-11-30 22:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-28 12:19:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
proposed patch (537 bytes, patch)
2007-08-21 17:17 UTC, Jeff Layton
no flags Details | Diff

Description Jeff Layton 2007-08-21 16:58:28 UTC
Noticed by inspection...

On a fcntl unlock request CIFS walks the list of SMB locks on a file and unlocks
any that fall completely within the unlock range. The test used is bogus though:

     if (pfLock->fl_start <= li->offset && length >= li->length) {

...this should be:

     if (pfLock->fl_start <= li->offset &&
           (pflock->fl_start + length) >=
           (li->offset + li->length)) {

Comment 1 Jeff Layton 2007-08-21 17:07:28 UTC
Trivial reproducer:

open file
lock: start=0 len=1
lock: start=2 len=1
unlock: start=0 len=1

...on the unlock, the client sends an unlock request to the server for both
locks even though the unlock range doesn't come near the second lock.


Comment 2 Jeff Layton 2007-08-21 17:17:58 UTC
Created attachment 161991 [details]
proposed patch

Proposed patch that I sent to linux-cifs-client list.

Comment 3 Jeff Layton 2007-08-28 12:19:52 UTC
Patch is now applied upstream and should make it into 2.6.24.



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