Commit Graph

14 Commits

Author SHA1 Message Date
Nalin Dahyabhai 0c63c6ab74 Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-05-21 11:54:44 -04:00
Nalin Dahyabhai 104cf50abf Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-05-08 14:42:51 -04:00
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
Nalin Dahyabhai 2805a4374f layerStore.Put(): always check for Create() errors
If we needed to try to update the ID mappings on a just-created layer,
we were inadvertently failing to check that the layer had been
successfully created.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-09-21 16:05:28 -04:00
Daniel J Walsh 1538971882
Change Mounted to return the number of times mounted
podman unmount wants to know if the image is only mounted 1 time
and refuse to unmount if the container state expects it to be mounted.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-07-17 16:27:27 -04:00
Daniel J Walsh 1075a73cac
Modify storage to allow callers to determine if a mount point is mounted
Add force to umount to force the umount of a container image
Add an interface to indicate whether or not the layer is mounted
Add a boolean return from unmount to indicate when the layer is really unmounted

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-07-17 14:00:15 -04: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
Daniel J Walsh 5a785c73f4 Pass MountLabel down to diff drivers
Currently when we do a commmit, we are mounting the container without using
the mountlabel.  In certain situations we can leak mount points where the
image is already mounted with a label.  If you then attempt to commit the
image, the kernel will attempt to mount the image without a label.  The
kernel will reject this mount since SELinux does not allow the same image
to be mounted with different labels.

Passing down the label to the diff drivers, fixes this issue.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-02-06 13:42:25 -05:00
Antonio Murdaca c59c6a878c use ffjson to encode/decode layer structs
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-10-13 13:59:22 -04:00