]> www.infradead.org Git - users/willy/pagecache.git/commit
kheaders: Ignore silly-rename files
authorDavid Howells <dhowells@redhat.com>
Fri, 13 Dec 2024 13:50:01 +0000 (13:50 +0000)
committerChristian Brauner <brauner@kernel.org>
Fri, 20 Dec 2024 21:07:55 +0000 (22:07 +0100)
commit973b710b8821c3401ad7a25360c89e94b26884ac
tree40daaf54e5e62c8cdc6fb2aa0a4cf3c414f9f363
parent974e3fe0ac61de85015bbe5a4990cf4127b304b2
kheaders: Ignore silly-rename files

Tell tar to ignore silly-rename files (".__afs*" and ".nfs*") when building
the header archive.  These occur when a file that is open is unlinked
locally, but hasn't yet been closed.  Such files are visible to the user
via the getdents() syscall and so programs may want to do things with them.

During the kernel build, such files may be made during the processing of
header files and the cleanup may get deferred by fput() which may result in
tar seeing these files when it reads the directory, but they may have
disappeared by the time it tries to open them, causing tar to fail with an
error.  Further, we don't want to include them in the tarball if they still
exist.

With CONFIG_HEADERS_INSTALL=y, something like the following may be seen:

   find: './kernel/.tmp_cpio_dir/include/dt-bindings/reset/.__afs2080': No such file or directory
   tar: ./include/linux/greybus/.__afs3C95: File removed before we read it

The find warning doesn't seem to cause a problem.

Fix this by telling tar when called from in gen_kheaders.sh to exclude such
files.  This only affects afs and nfs; cifs uses the Windows Hidden
attribute to prevent the file from being seen.

Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20241213135013.2964079-2-dhowells@redhat.com
cc: Masahiro Yamada <masahiroy@kernel.org>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-nfs@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
kernel/gen_kheaders.sh