Ignore:
Timestamp:
May 4, 2015, 7:21:36 PM (10 years ago)
Author:
Silvan Scherrer
Message:

Samba server 3.6: fixed some tdb problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/tdb/common/io.c

    r866 r878  
    102102        //    first and add the write lock afterwards
    103103        // 3. we remove the write lock further down
    104         // 4. we might add the removed lock from step #2 again
     104        // 4. we add the removed lock from step #2 again
    105105        int upgradeLockRC = 0;
    106106        int unlockRC = -1;
    107107        upgradeLockRC = tdb_brlock(tdb, F_WRLCK, off, len, TDB_LOCK_NOWAIT);
    108108        if (upgradeLockRC != 0) {
    109                 unlockRC = tdb_brunlock(tdb, F_RDLCK, off, len);
     109                unlockRC = tdb_brunlock(tdb, F_RDLCK, off, 1);
    110110                upgradeLockRC = tdb_brlock(tdb, F_WRLCK, off, len, TDB_LOCK_NOWAIT);
    111111        }
     
    144144                        if (upgradeLockRC == 0)
    145145                                tdb_brunlock( tdb, F_WRLCK, off, len);
     146                        if (unlockRC == 0)
     147                                tdb_brlock( tdb, F_RDLCK, off, 1, TDB_LOCK_WAIT);
    146148#endif
    147149                        return -1;
     
    151153        if (upgradeLockRC == 0)
    152154                tdb_brunlock( tdb, F_WRLCK, off, len);
     155        if (unlockRC == 0)
     156                tdb_brlock( tdb, F_RDLCK, off, 1, TDB_LOCK_WAIT);
    153157#endif
    154158        return 0;
Note: See TracChangeset for help on using the changeset viewer.