Skip to content

Rename overlayfs to overlay#9426

Merged
crosbymichael merged 3 commits intomoby:masterfrom
lhuard1A:overlay_rename
Dec 3, 2014
Merged

Rename overlayfs to overlay#9426
crosbymichael merged 3 commits intomoby:masterfrom
lhuard1A:overlay_rename

Conversation

@lhuard1A
Copy link
Contributor

@lhuard1A lhuard1A commented Dec 1, 2014

Since Linux 3.18-rc6, overlayfs has been renamed overlay.

This change was introduced by the following commit in linux.git:
ef94b1864d1ed5be54376404bb23d22ed0481feb ovl: rename filesystem type to "overlay"

Signed-off-by: Lénaïc Huard lhuard@amadeus.com

@cpuguy83
Copy link
Member

cpuguy83 commented Dec 1, 2014

Should we not check for either overlayfs OR overlay since one can still compile in their own, which would be called overlayfs?

@lhuard1A
Copy link
Contributor Author

lhuard1A commented Dec 1, 2014

@cpuguy83 : Good point. I’ll update this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not switch this to single quotes and thus just 'OVERLAY\(FS\)\?_FS'? (so it's simpler to read)

Nice catch noticing that this passes down to zgrep so a regex can be used here! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed
I pushed that change.

@tianon
Copy link
Member

tianon commented Dec 1, 2014

nice, contrib change LGTM

@jessfraz jessfraz added this to the 1.4 milestone Dec 1, 2014
@jessfraz
Copy link
Contributor

jessfraz commented Dec 1, 2014

ok well one of these needs to be in 1.4, @vbatts wdyt

@crosbymichael
Copy link
Contributor

@cpuguy83 I don't think it would make sense to check for both. We should use the term that will be in the 3.18 final and not worry about people compiling the rcs right now.

@cpuguy83
Copy link
Member

cpuguy83 commented Dec 1, 2014

@crosbymichael Not compiling the rc's, rather compiling overlayfs, which is why they changed the name to "overylay" in the kernel.

@vbatts
Copy link
Contributor

vbatts commented Dec 1, 2014

@crosbymichael I think the issue is whether other distros would latch onto
one vs. the other.
On Dec 1, 2014 8:29 PM, "Michael Crosby" notifications@github.com wrote:

@cpuguy83 https://github.com/cpuguy83 I don't think it would make sense
to check for both. We should use the term that will be in the 3.18 final
and not worry about people compiling the rcs right now.


Reply to this email directly or view it on GitHub
#9426 (comment).

@tianon
Copy link
Member

tianon commented Dec 1, 2014

Can you even download and use non-in-kernel overlayfs anymore? I can't
find a solid source for it (the main Git repo it used to live in is 404).

@crosbymichael
Copy link
Contributor

Ugh, great...

@cpuguy83
Copy link
Member

cpuguy83 commented Dec 1, 2014

See the commit message here: http://comments.gmane.org/gmane.linux.kernel.commits.head/489835

I'm really not sure. Is this driver compatible with the "old format"?

@jessfraz
Copy link
Contributor

jessfraz commented Dec 1, 2014

@alexlarsson do you happen to know if the driver is compatible with the "old format" overlayfs, as well as the new format (now referred to as) "overlay"?

@crosbymichael
Copy link
Contributor

We should support the one in the kernel and nothing more.

@jessfraz
Copy link
Contributor

jessfraz commented Dec 1, 2014

okay so "overlay", so the code LGTM, but I am building the latest kernel now

@alexlarsson
Copy link
Contributor

@jfrazelle "overlayfs" has been the name a long time and its had different formats over that time, so i think its better to only support the final one (i.e. "overlay")

@jessfraz
Copy link
Contributor

jessfraz commented Dec 2, 2014

So we should change this from strings.Contains to == no?

On Monday, December 1, 2014, Alexander Larsson notifications@github.com
wrote:

@jfrazelle https://github.com/jfrazelle "overlayfs" has been the name a
long time and its had different formats over that time, so i think its
better to only support the final one (i.e. "overlay")


Reply to this email directly or view it on GitHub
#9426 (comment).

Since Linux 3.18-rc6, overlayfs has been renamed overlay.

This change was introduced by the following commit in linux.git:
ef94b1864d1ed5be54376404bb23d22ed0481feb ovl: rename filesystem type to "overlay"

Signed-off-by: Lénaïc Huard <lhuard@amadeus.com>
@lhuard1A
Copy link
Contributor Author

lhuard1A commented Dec 2, 2014

Following your advises, I updated the PR to use only "overlay".
@jfrazelle : I also replaced the strings.Contains in order to not match if we find overlayfs.

@jeremyeder
Copy link

I find it a bit strange that even with this patch, I still need to run the docker daemon with -s overlayfs rather than -s overlay.

Other than that, the patch works fine. Thanks!

@jessfraz
Copy link
Contributor

jessfraz commented Dec 2, 2014

nice catch @jeremyeder we should change the docs and https://github.com/docker/docker/blob/916a10dd91d7113d65a3aef8316643d913fbaaf7/daemon/graphdriver/driver.go#L84 to be in line with the wording as well, unless you all think this is something we don't need?

@tianon
Copy link
Member

tianon commented Dec 2, 2014

+1 for updating all the "overlayfs" references to "overlay" consistently

@tianon
Copy link
Member

tianon commented Dec 2, 2014

$ git grep -in overlayfs
contrib/check-config.sh:168:    echo '- "'$(wrap_color 'overlayfs' blue)'":'
contrib/check-config.sh:169:    check_flags OVERLAYFS_FS | sed 's/^/  /'
daemon/daemon_overlayfs.go:1:// +build !exclude_graphdriver_overlayfs
daemon/daemon_overlayfs.go:6:   _ "github.com/docker/docker/daemon/graphdriver/overlayfs"
daemon/graphdriver/driver.go:84:        "overlayfs",
daemon/graphdriver/overlayfs/copy.go:3:package overlayfs
daemon/graphdriver/overlayfs/copy.go:125:       // We need to copy this attribute if it appears in an overlayfs upper layer, as
daemon/graphdriver/overlayfs/copy.go:126:       // this function is used to copy those. It is set by overlayfs if a directory
daemon/graphdriver/overlayfs/overlayfs.go:3:package overlayfs
daemon/graphdriver/overlayfs/overlayfs.go:54:// This backend uses the overlayfs union filesystem for containers
daemon/graphdriver/overlayfs/overlayfs.go:58:// filesystem hierarchy, or they can use overlayfs.
daemon/graphdriver/overlayfs/overlayfs.go:60:// If they use overlayfs there is a "upper" directory and a "lower-id"
daemon/graphdriver/overlayfs/overlayfs.go:65:// directory, and the "work" dir is needed for overlayfs to work.
daemon/graphdriver/overlayfs/overlayfs.go:94:   graphdriver.Register("overlayfs", Init)
daemon/graphdriver/overlayfs/overlayfs.go:98:   if err := supportsOverlayfs(); err != nil {
daemon/graphdriver/overlayfs/overlayfs.go:115:func supportsOverlayfs() error {
daemon/graphdriver/overlayfs/overlayfs.go:116:  // We can try to modprobe overlayfs first before looking at
daemon/graphdriver/overlayfs/overlayfs.go:117:  // proc/filesystems for when overlayfs is supported
daemon/graphdriver/overlayfs/overlayfs.go:118:  exec.Command("modprobe", "overlayfs").Run()
daemon/graphdriver/overlayfs/overlayfs.go:128:      if strings.Contains(s.Text(), "overlayfs") {
daemon/graphdriver/overlayfs/overlayfs.go:132:  log.Error("'overlayfs' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlayfs support loaded.")
daemon/graphdriver/overlayfs/overlayfs.go:137:  return "overlayfs"
daemon/graphdriver/overlayfs/overlayfs.go:179:  // If parent has a root, just do a overlayfs to it
daemon/graphdriver/overlayfs/overlayfs.go:277:  if err := syscall.Mount("overlayfs", mergedDir, "overlayfs", 0, label.FormatMountLabel(opts, mountLabel)); err != nil {
daemon/graphdriver/overlayfs/overlayfs.go:305:          log.Debugf("Failed to unmount %s overlayfs: %v", id, err)
daemon/graphdriver/overlayfs/overlayfs_test.go:1:package overlayfs
daemon/graphdriver/overlayfs/overlayfs_test.go:9:// Make sure to put new tests between TestOverlayfsSetup and TestOverlayfsTeardown
daemon/graphdriver/overlayfs/overlayfs_test.go:10:func TestOverlayfsSetup(t *testing.T) {
daemon/graphdriver/overlayfs/overlayfs_test.go:11:  graphtest.GetDriver(t, "overlayfs")
daemon/graphdriver/overlayfs/overlayfs_test.go:14:func TestOverlayfsCreateEmpty(t *testing.T) {
daemon/graphdriver/overlayfs/overlayfs_test.go:15:  graphtest.DriverTestCreateEmpty(t, "overlayfs")
daemon/graphdriver/overlayfs/overlayfs_test.go:18:func TestOverlayfsCreateBase(t *testing.T) {
daemon/graphdriver/overlayfs/overlayfs_test.go:19:  graphtest.DriverTestCreateBase(t, "overlayfs")
daemon/graphdriver/overlayfs/overlayfs_test.go:22:func TestOverlayfsCreateSnap(t *testing.T) {
daemon/graphdriver/overlayfs/overlayfs_test.go:23:  graphtest.DriverTestCreateSnap(t, "overlayfs")
daemon/graphdriver/overlayfs/overlayfs_test.go:26:func TestOverlayfsTeardown(t *testing.T) {
docs/sources/reference/commandline/cli.md:159:`devicemapper`, `btrfs` and `overlayfs`.
docs/sources/reference/commandline/cli.md:178:The `overlayfs` is a very fast union filesystem. It is now merged in the main
docs/sources/reference/commandline/cli.md:180:Call `docker -d -s overlayfs` to use it.

so that docker is started with `docker -d -s overlay` instead of `docker -d -s overlayfs`

Signed-off-by: Lénaïc Huard <lhuard@amadeus.com>
This only renames docker internal structures.
It has no impact on the end-user.

Signed-off-by: Lénaïc Huard <lhuard@amadeus.com>
@lhuard1A
Copy link
Contributor Author

lhuard1A commented Dec 3, 2014

I added

  • one commit to rename the storage driver so that the daemon can be started with docker -d -s overlay
  • another commit to remove all the remaining references to overlayfs without any impact on the end-user.
    They can eventually be squashed after review.

@jessfraz
Copy link
Contributor

jessfraz commented Dec 3, 2014

awesome LGTM

@crosbymichael
Copy link
Contributor

LGTM

crosbymichael added a commit that referenced this pull request Dec 3, 2014
@crosbymichael crosbymichael merged commit 5d49d2b into moby:master Dec 3, 2014
@jeremyeder
Copy link

-s overlay now works properly, thanks.

If you had -s overlayfs in your unitfile/init script, docker will now fail to start after this patch. Change your unitfile/init script to -s overlay and ensure your kernel is recent enough to call the module 'overlay'.

IOW you need a matching pair: a version of docker that calls it overlay (anything after this PR), plus a kernel that calls it overlay, which happened in kernel commit ecde00642c79c2dfc9006e7751ee60bd0e21e1e9 (v3.18-rc5-191-gecde006).

@lhuard1A lhuard1A deleted the overlay_rename branch December 4, 2014 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants