Commit Graph

9 Commits

Author SHA1 Message Date
Valentin Rothberg f58686dcce lockfile: implement reader-writer locks
Implement reader-writer locks to allow allow multiple readers to hold
the lock in parallel.

* The locks are still based on fcntl(2).

* Changing the lock from a reader to a writer and vice versa will block
  on the syscall.

* A writer lock can be held only by one process.  To protect against
  concurrent accesses by gourtines within the same process space, use a
  writer mutex.

* Extend the Locker interface with the `RLock()` method to acquire a
  reader lock.  If the lock is set to be read-only, all calls to
  `Lock()` will be redirected to `RLock()`.  A reader lock is only
  released via fcntl(2) when all gourtines within the same process space
  have unlocked it.  This is done via an internal counter which is
  protected (among other things) by an internal state mutex.

* Panic on violations of the lock protocol, namely when calling
  `Unlock()` on an unlocked lock.  This helps detecting violations in
  the code but also protects the storage from corruption.  Doing this
  has revealed some bugs fixed in ealier commits.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-15 09:49:44 +01:00
Nalin Dahyabhai e87802be3e Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-01-17 14:30:04 -05:00
Daniel J Walsh ab6be50561
Allow the passing in and retrieval of mount options
We want to allow tools like podman/buildah to override default storage
container mount options on a container by container basis.

For example if the default mount options for containers/storage include
nodev or nosuid, we want to allow podman to turn these off if the user
specifies --privileged.

We also might want to turn off certain user namespace flags that will cause
buildah and podman build to work slower when creating container images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-11-19 19:14:21 -05:00
Marco Vedovati d990e2b322 Improve duplicate name error message on container create
Signed-off-by: Marco Vedovati <mvedovati@suse.com>

Make the error message more informative by specifying the duplicate name
and the existing container ID.
2018-06-19 20:02:51 +02:00
Nalin Dahyabhai e358e50c67 Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-05-30 17:18:10 -04:00
Nalin Dahyabhai 0a4c1e32ca Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-05-07 10:38:17 -04:00
Nalin Dahyabhai 08b614b4c8 Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-04-03 10:34:32 -04:00
Nalin Dahyabhai 986c508887 Update ffjson-generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-03-07 17:07:39 -05:00
Nalin Dahyabhai f109e5ac0c Make sure layers_ffjson.go is always current
Add a rule to make sure that layers_ffjson.go is regenerated whenever
we've updated layers.go, and do the same for images.go and containers.go.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-10-13 14:18:40 -04:00