Browse Source

Merge pull request #8891 from gyuho/bbb

vendor: coreos/bbolt v1.3.1-coreos.5
Gyu-Ho Lee 8 years ago
parent
commit
3766b04b38
3 changed files with 10 additions and 7 deletions
  1. 6 3
      cmd/vendor/github.com/coreos/bbolt/freelist.go
  2. 3 3
      glide.lock
  3. 1 1
      glide.yaml

+ 6 - 3
cmd/vendor/github.com/coreos/bbolt/freelist.go

@@ -132,9 +132,9 @@ func (f *freelist) free(txid txid, p *page) {
 	allocTxid, ok := f.allocs[p.id]
 	if ok {
 		delete(f.allocs, p.id)
-	} else if (p.flags & (freelistPageFlag | metaPageFlag)) != 0 {
-		// Safe to claim txid as allocating since these types are private to txid.
-		allocTxid = txid
+	} else if (p.flags & freelistPageFlag) != 0 {
+		// Freelist is always allocated by prior tx.
+		allocTxid = txid - 1
 	}
 
 	for id := p.id; id <= p.id+pgid(p.overflow); id++ {
@@ -233,6 +233,9 @@ func (f *freelist) freed(pgid pgid) bool {
 
 // read initializes the freelist from a freelist page.
 func (f *freelist) read(p *page) {
+	if (p.flags & freelistPageFlag) == 0 {
+		panic(fmt.Sprintf("invalid freelist page: %d, page type is %s", p.id, p.typ()))
+	}
 	// If the page.count is at the max uint16 value (64k) then it's considered
 	// an overflow and the size of the freelist is stored as the first element.
 	idx, count := 0, int(p.count)

+ 3 - 3
glide.lock

@@ -1,5 +1,5 @@
-hash: 0d3f3703d96e2e3e92b8488d93429062ad0c9d5034b12001e73746c7eee434a3
-updated: 2017-11-14T13:55:48.257041-08:00
+hash: 2244aad388c98d02a53083ff704bc2f5da72978ef7330ef588ced88822b70e23
+updated: 2017-11-16T10:30:18.004311-08:00
 imports:
 - name: github.com/beorn7/perks
   version: 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
@@ -8,7 +8,7 @@ imports:
 - name: github.com/bgentry/speakeasy
   version: 4aabc24848ce5fd31929f7d1e4ea74d3709c14cd
 - name: github.com/coreos/bbolt
-  version: 3c6cbfb299c11444eb2f8c9d48f0d2ce09157423
+  version: 32c383e75ce054674c53b5a07e55de85332aee14
 - name: github.com/coreos/go-semver
   version: 8ab6407b697782a06568d4b7f1db25550ec2e4c6
   subpackages:

+ 1 - 1
glide.yaml

@@ -5,7 +5,7 @@ import:
 - package: github.com/bgentry/speakeasy
   version: v0.1.0
 - package: github.com/coreos/bbolt
-  version: v1.3.1-coreos.3
+  version: v1.3.1-coreos.5
 - package: github.com/coreos/go-semver
   version: v0.2.0
   subpackages: