linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker
@ 2016-05-16  6:45 Daniel Axtens
  2016-05-16 13:07 ` Vivek Goyal
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Axtens @ 2016-05-16  6:45 UTC (permalink / raw)
  To: vgoyal, linux-fsdevel, linux-unionfs, linux-kernel
  Cc: mpe, mszeredi, dchinner

Hi,

I installed a fresh 4.6.0 kernel on my ppc64le system, and tried to run
a docker container. It failed.

Docker gave me errors like this:

docker: Error response from daemon: error creating overlay mount to /var/lib/docker/overlay/2bc07cedad2770da2f384d5c1e81a6f45fa3c44a7658f10d02e5973ef76620fc-init/merged: invalid argument.

In dmesg, I'm seeing:

overlayfs: upper fs needs to support d_type.

Reverting 45aebeaf4f67 ("ovl: Ensure upper filesystem supports d_type")
fixes the issue for me. I haven't investigated the root cause yet - at a
guess I'd say either Docker's layering system, or some weird interaction
with namespacing, maybe? I'll have a look when I get a spare moment.

For reference, I'm using docker 1.11.0-dev.

Regards,
Daniel Axtens

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker
  2016-05-16  6:45 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker Daniel Axtens
@ 2016-05-16 13:07 ` Vivek Goyal
  2016-05-17  6:28   ` Al Viro
  2016-05-17 22:39   ` Daniel Axtens
  0 siblings, 2 replies; 8+ messages in thread
From: Vivek Goyal @ 2016-05-16 13:07 UTC (permalink / raw)
  To: Daniel Axtens
  Cc: linux-fsdevel, linux-unionfs, linux-kernel, mpe, mszeredi, dchinner

On Mon, May 16, 2016 at 04:45:09PM +1000, Daniel Axtens wrote:
> Hi,
> 
> I installed a fresh 4.6.0 kernel on my ppc64le system, and tried to run
> a docker container. It failed.
> 
> Docker gave me errors like this:
> 
> docker: Error response from daemon: error creating overlay mount to /var/lib/docker/overlay/2bc07cedad2770da2f384d5c1e81a6f45fa3c44a7658f10d02e5973ef76620fc-init/merged: invalid argument.
> 
> In dmesg, I'm seeing:
> 
> overlayfs: upper fs needs to support d_type.
> 

Hi Daniel,

What't the underlying fs you are using. overlayfs requires underlying
filesystem to support d_type and there were cases where xfs was
built with ftype=0 and in that case xfs does not support d_type. That
means it led to issues like whiteouts not being recognized and being
left behind during various operations.

So it became clear that we need a check at mount time to make sure
d_type is supported otherwise error out. This will require users to
do mkfs.xfs with ftype=1 to make progress.

I think new defaults for mkfs.xfs are such that ftype=1 is set. I am
not sure which version that change was made in.

Thanks
Vivek

> Reverting 45aebeaf4f67 ("ovl: Ensure upper filesystem supports d_type")
> fixes the issue for me. I haven't investigated the root cause yet - at a
> guess I'd say either Docker's layering system, or some weird interaction
> with namespacing, maybe? I'll have a look when I get a spare moment.
> 
> For reference, I'm using docker 1.11.0-dev.
> 
> Regards,
> Daniel Axtens

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker
  2016-05-16 13:07 ` Vivek Goyal
@ 2016-05-17  6:28   ` Al Viro
  2016-05-17  8:15     ` Miklos Szeredi
  2016-05-17 22:39   ` Daniel Axtens
  1 sibling, 1 reply; 8+ messages in thread
From: Al Viro @ 2016-05-17  6:28 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: Daniel Axtens, linux-fsdevel, linux-unionfs, linux-kernel, mpe,
	mszeredi, dchinner

On Mon, May 16, 2016 at 09:07:27AM -0400, Vivek Goyal wrote:
> So it became clear that we need a check at mount time to make sure
> d_type is supported otherwise error out. This will require users to
> do mkfs.xfs with ftype=1 to make progress.
> 
> I think new defaults for mkfs.xfs are such that ftype=1 is set. I am
> not sure which version that change was made in.

Dumb question - can we end up with empty workdir at that point?  Because
if we do, the check would appear to return a false negative, no matter
what fs supports...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker
  2016-05-17  6:28   ` Al Viro
@ 2016-05-17  8:15     ` Miklos Szeredi
  2016-05-17 12:10       ` Vivek Goyal
  0 siblings, 1 reply; 8+ messages in thread
From: Miklos Szeredi @ 2016-05-17  8:15 UTC (permalink / raw)
  To: Al Viro
  Cc: Vivek Goyal, Daniel Axtens, linux-fsdevel, linux-unionfs,
	linux-kernel, mpe, dchinner

On Tue, May 17, 2016 at 8:28 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Mon, May 16, 2016 at 09:07:27AM -0400, Vivek Goyal wrote:
>> So it became clear that we need a check at mount time to make sure
>> d_type is supported otherwise error out. This will require users to
>> do mkfs.xfs with ftype=1 to make progress.
>>
>> I think new defaults for mkfs.xfs are such that ftype=1 is set. I am
>> not sure which version that change was made in.
>
> Dumb question - can we end up with empty workdir at that point?  Because
> if we do, the check would appear to return a false negative, no matter
> what fs supports...

ovl_workdir_create() creates a subdirectory of workdir ("work") so
workdir itself won't be empty after that.  If somebody else messes
with workdir, then we are screwed anyway.

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker
  2016-05-17  8:15     ` Miklos Szeredi
@ 2016-05-17 12:10       ` Vivek Goyal
  2016-05-17 14:24         ` Miklos Szeredi
  2016-05-18  3:33         ` Daniel Axtens
  0 siblings, 2 replies; 8+ messages in thread
From: Vivek Goyal @ 2016-05-17 12:10 UTC (permalink / raw)
  To: Miklos Szeredi, Daniel Axtens
  Cc: Al Viro, linux-fsdevel, linux-unionfs, linux-kernel, mpe, dchinner

On Tue, May 17, 2016 at 10:15:21AM +0200, Miklos Szeredi wrote:
> On Tue, May 17, 2016 at 8:28 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > On Mon, May 16, 2016 at 09:07:27AM -0400, Vivek Goyal wrote:
> >> So it became clear that we need a check at mount time to make sure
> >> d_type is supported otherwise error out. This will require users to
> >> do mkfs.xfs with ftype=1 to make progress.
> >>
> >> I think new defaults for mkfs.xfs are such that ftype=1 is set. I am
> >> not sure which version that change was made in.
> >
> > Dumb question - can we end up with empty workdir at that point?  Because
> > if we do, the check would appear to return a false negative, no matter
> > what fs supports...
> 
> ovl_workdir_create() creates a subdirectory of workdir ("work") so
> workdir itself won't be empty after that.  If somebody else messes
> with workdir, then we are screwed anyway.

Right. Initially I was creating a directory of my own and later realized
that ovl_workdir_create() already creates one.

Having said that, what happens when ovl_workdir_create() fails and we
mount overlayfs read only. In that case I think we will conclude that
underlying fs does not support d_type and mounting will fail.

Any thoughts, on how to handle this failure path better?

Daniel,

Yesterday Eric Sandeen told me that I can run "xfs_info <mount-point>" to
figure out if ftype is 0 or 1. You might want to run "xfs_info /" and 
ensure ftype=0 in your case and overlay is not detecting it wrong.

Thanks
Vivek

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker
  2016-05-17 12:10       ` Vivek Goyal
@ 2016-05-17 14:24         ` Miklos Szeredi
  2016-05-18  3:33         ` Daniel Axtens
  1 sibling, 0 replies; 8+ messages in thread
From: Miklos Szeredi @ 2016-05-17 14:24 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: Miklos Szeredi, Daniel Axtens, Al Viro, linux-fsdevel,
	linux-unionfs, Kernel Mailing List, mpe, dchinner

On Tue, May 17, 2016 at 2:10 PM, Vivek Goyal <vgoyal@redhat.com> wrote:

> Having said that, what happens when ovl_workdir_create() fails and we
> mount overlayfs read only. In that case I think we will conclude that
> underlying fs does not support d_type and mounting will fail.

Good point, I missed that.

> Any thoughts, on how to handle this failure path better?

Just skip the d_type test.  We won't create whiteouts that way (and
whiteouts would only have been created with a previous kernel that
didn't have this test, which I don't think is a very interesting
case).

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker
  2016-05-16 13:07 ` Vivek Goyal
  2016-05-17  6:28   ` Al Viro
@ 2016-05-17 22:39   ` Daniel Axtens
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Axtens @ 2016-05-17 22:39 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: linux-fsdevel, linux-unionfs, linux-kernel, mpe, mszeredi, dchinner

Hi Vivek,

Sorry for the delay in getting back to you.


> What't the underlying fs you are using. overlayfs requires underlying
> filesystem to support d_type and there were cases where xfs was
> built with ftype=0 and in that case xfs does not support d_type. That
> means it led to issues like whiteouts not being recognized and being
> left behind during various operations.

I'm using ext4 as the backing filesystem for Docker.

However, if I manually mount an overlay directly on the ext4 fs, it
works just fine.

Therefore, I suspect the problem arises through some magic Docker is
doing. I think it is layering overlays and may be doing that in some
weird way.

I'm hopefully going to get some more time to spend on this problem (and
on that machine) today. As soon as I can unpick what Docker is doing
I'll post more details.

Regards,
Daniel

>
> So it became clear that we need a check at mount time to make sure
> d_type is supported otherwise error out. This will require users to
> do mkfs.xfs with ftype=1 to make progress.
>
> I think new defaults for mkfs.xfs are such that ftype=1 is set. I am
> not sure which version that change was made in.
>
> Thanks
> Vivek
>
>> Reverting 45aebeaf4f67 ("ovl: Ensure upper filesystem supports d_type")
>> fixes the issue for me. I haven't investigated the root cause yet - at a
>> guess I'd say either Docker's layering system, or some weird interaction
>> with namespacing, maybe? I'll have a look when I get a spare moment.
>> 
>> For reference, I'm using docker 1.11.0-dev.
>> 
>> Regards,
>> Daniel Axtens

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker
  2016-05-17 12:10       ` Vivek Goyal
  2016-05-17 14:24         ` Miklos Szeredi
@ 2016-05-18  3:33         ` Daniel Axtens
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Axtens @ 2016-05-18  3:33 UTC (permalink / raw)
  To: Vivek Goyal, Miklos Szeredi
  Cc: Al Viro, linux-fsdevel, linux-unionfs, linux-kernel, mpe, dchinner

Hi Vivek,

My sincere apologies - it turns out I *was* running on xfs with
ftype=0. Someone in the office had moved docker's storage without
me noticing.

Apologies to all whose time I wasted.

Regards,
Daniel

Vivek Goyal <vgoyal@redhat.com> writes:

> On Tue, May 17, 2016 at 10:15:21AM +0200, Miklos Szeredi wrote:
>> On Tue, May 17, 2016 at 8:28 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>> > On Mon, May 16, 2016 at 09:07:27AM -0400, Vivek Goyal wrote:
>> >> So it became clear that we need a check at mount time to make sure
>> >> d_type is supported otherwise error out. This will require users to
>> >> do mkfs.xfs with ftype=1 to make progress.
>> >>
>> >> I think new defaults for mkfs.xfs are such that ftype=1 is set. I am
>> >> not sure which version that change was made in.
>> >
>> > Dumb question - can we end up with empty workdir at that point?  Because
>> > if we do, the check would appear to return a false negative, no matter
>> > what fs supports...
>> 
>> ovl_workdir_create() creates a subdirectory of workdir ("work") so
>> workdir itself won't be empty after that.  If somebody else messes
>> with workdir, then we are screwed anyway.
>
> Right. Initially I was creating a directory of my own and later realized
> that ovl_workdir_create() already creates one.
>
> Having said that, what happens when ovl_workdir_create() fails and we
> mount overlayfs read only. In that case I think we will conclude that
> underlying fs does not support d_type and mounting will fail.
>
> Any thoughts, on how to handle this failure path better?
>
> Daniel,
>
> Yesterday Eric Sandeen told me that I can run "xfs_info <mount-point>" to
> figure out if ftype is 0 or 1. You might want to run "xfs_info /" and 
> ensure ftype=0 in your case and overlay is not detecting it wrong.
>
> Thanks
> Vivek

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-05-18  3:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-16  6:45 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker Daniel Axtens
2016-05-16 13:07 ` Vivek Goyal
2016-05-17  6:28   ` Al Viro
2016-05-17  8:15     ` Miklos Szeredi
2016-05-17 12:10       ` Vivek Goyal
2016-05-17 14:24         ` Miklos Szeredi
2016-05-18  3:33         ` Daniel Axtens
2016-05-17 22:39   ` Daniel Axtens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).