From owner-freebsd-bugs@freebsd.org Sun May 22 22:03:04 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCF34B4512D for ; Sun, 22 May 2016 22:03:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C2AD1397 for ; Sun, 22 May 2016 22:03:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u4MM345p017846 for ; Sun, 22 May 2016 22:03:04 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 184340] PATH_MAX not interoperable with Linux Date: Sun, 22 May 2016 22:03:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 9.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: s_bugzilla@nedprod.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 22:03:04 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D184340 --- Comment #6 from Niall Douglas --- (In reply to Jilles Tjoelker from comment #5) I appreciate the detail in your reply. However, this is not a code developm= ent problem - as you mention, openat() is the correct solution to programming l= ong paths. Rather it's a user problem - we are stuck with software written by others which was designed around a Linux PATH_MAX of 4096. Being that we ca= nnot rewrite all this software to not be so stupid, it generates substantial got= chas for end users. In terms of how to refactor the BSD kernel to handle this, I believe NT sim= ply uses dynamic memory allocation for all paths, and therefore the 64Kb path l= imit is tractable except when frequently modifying paths as the win32 layer like= s to do. An ideal solution for BSD would be some sort of variant storage which c= ould be either 256 bytes of path or a dynamic memory allocation to a path. Perha= ps a zero length path could mean "pointer to a dynamically allocated path follow= s", so something like: union { char path[256]; // for paths < 255 struct { char _zero; // lowest byte in memory is zero char _magic; // magic marker byte to detect unioned path unsigned short length; // length of path char *path; // dynamically allocated pointer to path }; }; Anyway, I'm no expert in the BSD kernel, but I would find it nice to not ha= ve to install ZFS on Linux just so I can zfs snapshot the volume onto FreeBSD = as my sole method of working around the BSD PATH_MAX limit. --=20 You are receiving this mail because: You are the assignee for the bug.=