Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754863AbcKYOvi (ORCPT ); Fri, 25 Nov 2016 09:51:38 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:19131 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754421AbcKYOv3 (ORCPT ); Fri, 25 Nov 2016 09:51:29 -0500 Date: Fri, 25 Nov 2016 15:56:04 +0100 From: Quentin Casasnovas To: Miklos Szeredi Cc: lkml , Al Viro Subject: opening a file on a stacked overlayfs is broken. Message-ID: <20161125145604.GG6842@chrystal.oracle.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vJguvTgX93MxBIIe" Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2028 Lines: 60 --vJguvTgX93MxBIIe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Stacking an overlayfs on top of an overlayfs doens't work when it used to (tested on v4.9-rc5): #!/bin/bash -xeu tmpdir=$(mktemp -d) pushd ${tmpdir} mkdir -p {upper,lower,work} echo 'foo' > lower/bar mount -t overlay level_zero upper -o lowerdir=lower,upperdir=upper,workdir=work cat upper/bar tmpdir2=$(mktemp -d) pushd ${tmpdir2} mkdir -p {upper,work} mount -t overlay level_one upper -o lowerdir=${tmpdir}/upper,upperdir=upper,workdir=work stat upper/bar # Works fine cat upper/bar # open() returns ENXIO I _think_ (I haven't bisected it) the guilty commit is 2d902671ce1c ("vfs: merge .d_select_inode() into .d_real()"), where vfs_open() -> uses d_real() with a a NULL inode, which prevents any recursion from happening, when before d_select_inode() would do the right thing and recurse. It should be noted this has already been broken and fixed in the past year in 1c8a47df36d7 ("ovl: fix open in stacked overlay"). Let me know if I can help, Q --vJguvTgX93MxBIIe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJYOFD+AAoJEB5Tt01po9cNGRYP/3r1lIJJJSLySqf6xzCxSkFG +KVTUQVkJoGSGlHRV65JD9lNm4XN9ur/wY2WO8omMUUqiwSCFZfTDKO2MdQNCCh8 piqqmNpAoOchgRv/JT634B/kmQ3aZFu1k4MgHBR96izAezZYK1D5O+NZuoVQH+Im P/WJF5HQeM+R7xAa6pNXw7LOjq/9bCXvf9A+/A+wYkPF9NIvoIQk9qdWNKXRAVUL 1DohJiLiP3IucbCPtkaYOVbqBvTzj3s6Ub3hC6jBnzhz1+TIrJ8M7SpsXq3Um+o3 pregU5HdMmuFKiW5AHBlbfAIyXlJMUZZ4ol0Hey2SiQfvoExkCPay+W+2x9lx7Qu V2sshSkAdTV7WG+G5IMexRR0P7+zMh2KlAchaslsTRNCUY5pQeJuIh37w+bzHA+l po+WFxxo1618/l5NvG3JXneWf8evBsw2CRQ5+k6WfjFarSJoEjWQnCHAScbUjQNi HWT/k7hjkJEdq1m+pFCGxkb8JPHBp0VCug42xNGueT738ih2viH4nGXqisFVZRKN rsEzSTla07OiLXGJGvvC2+NiNfiZHfD7h3XdjVRRg3GN48LpacOZ9KaNKPEraiCX ALk1PX+WON2EPSN4JWbPIMFRVT/lvd80Fj7lBVEJw9R5VdzEw3P4wgvMgMupAyPp Ek3EmJ7IPCLZO7+Ydicx =iukt -----END PGP SIGNATURE----- --vJguvTgX93MxBIIe--