From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.bugs Subject: bug#72641: 31.0.50; "Unlocking file: Invalid argument" when deleting lock file on network file system Date: Thu, 15 Aug 2024 19:44:16 +0200 Message-ID: <+b8wcnteufggsda3gtf7ioja@mina86.com> References: <867cfujge6.fsf@gnu.org> <86fruhiwt0.fsf@gnu.org> <868r09ivqn.fsf@gnu.org> <867cftiprt.fsf@gnu.org> <86msoph6wt.fsf@gnu.org> <2+lcnmedng9le3pwfn0gc79m@mina86.com> <86a5hd7o4t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37612"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72641@debbugs.gnu.org To: Eli Zaretskii , Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 15 19:46:47 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1seeYe-0009Yb-Bq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Aug 2024 19:46:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1seeYN-0005qP-QB; Thu, 15 Aug 2024 13:46:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seeYL-0005qF-Qk for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2024 13:46:25 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1seeYL-0002cp-GR for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2024 13:46:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=UVxe/82wa/HZEIho/j7XlxcGgCbc/0pHGHqWfdbtT9g=; b=pDIDG9MQG2hjPYug5IBqgDmYEv5k6qg6XACq7c7vP3YW8pzG88dsFnwzs8V/lu9ibaqh646mNwLqryjhbVc0HCMpvdPGgD5LNFpXCAIfowyk21MFn2eL6QuV9VlXV2HzTd0+6IGI66lwTJdQya6q15uuDir9wuhDpIz8huAswtEPbQ2gjmcFS1nMYhwH/2tBnT94xTUNud5NIYKMWYKKFduBwRj5ZPvyCKNvpS1qfi6WhtMvHLFO7jTeu1Z8MjDR0xh1qp+abWcymDyzphvltClNYc1wUUu6VhvwXsbVU2WQwHivtGnWShOt8LXhv4LlcXwQf0IATvAIvDQBMZtQ0A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1seeYv-0004gM-Mm for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2024 13:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michal Nazarewicz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2024 17:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72641 X-GNU-PR-Package: emacs Original-Received: via spool by 72641-submit@debbugs.gnu.org id=B72641.172374396317912 (code B ref 72641); Thu, 15 Aug 2024 17:47:01 +0000 Original-Received: (at 72641) by debbugs.gnu.org; 15 Aug 2024 17:46:03 +0000 Original-Received: from localhost ([127.0.0.1]:49705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seeXz-0004eo-4A for submit@debbugs.gnu.org; Thu, 15 Aug 2024 13:46:03 -0400 Original-Received: from mail-lf1-f45.google.com ([209.85.167.45]:38078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seeXx-0004eF-DQ for 72641@debbugs.gnu.org; Thu, 15 Aug 2024 13:46:02 -0400 Original-Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-52f00427236so225199e87.0 for <72641@debbugs.gnu.org>; Thu, 15 Aug 2024 10:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723743858; x=1724348658; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:face :references:in-reply-to:subject:cc:to:from:sender:from:to:cc:subject :date:message-id:reply-to; bh=UVxe/82wa/HZEIho/j7XlxcGgCbc/0pHGHqWfdbtT9g=; b=R2juPvb+TpviKbdiDVs3N3k0l0V2fVcmn4T92ekKlLCd1iohX7SQOK2IOGG2ovENjP nzLF9ef1S7j8/q4HAqNC0Z3GznDCEqma+YKoNiqzKfNqqxFpsPAigqlWCx3/q7MHTtPR j4/hdjjVhrF5cXsJkWUTbn4Ad63NWZ34sXsbflNtuUxb8QUlU0B0rizGtm+EVGmZiGRf xxsACqweoJMxXzVsxHTlB/o1T9bKT4t0RNEEXhJmXZk1Qri92ZSQjSs3KliD+liR4D3E lMaqFAxuCBbdWr/SV74feQllMHrS+wrxNAXBZosFOl1PBMVezqxgEJvYMu7cRYnVfRj0 2D1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723743858; x=1724348658; h=content-transfer-encoding:mime-version:message-id:date:face :references:in-reply-to:subject:cc:to:from:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=UVxe/82wa/HZEIho/j7XlxcGgCbc/0pHGHqWfdbtT9g=; b=imdtixejFznotVa0ShcgsSNpvM53wYihGwo8O9ljC6GparM6g6Y5VRL/qUPINy3ki8 vIlbHt/jfMG0imS04Fu5hrdzoefdeJTTz015GtJqydbuEZMThrCyjg5R+QXsKLtwcFNM F2vGEcRMSNf3FLFnEAjN5ZtVwQtgsdF9fTYwXWdYcrndkX2PivnK0gHBtdnJBH4nVzC3 yBwcgbZy6kjvbEi5OApLAVyJshzJ3donEMDjPoSm1xjTRm8yQ6rt/rJsHM4cxb6MINBW A2yZtMDCXqywIWZLKeTAo/Y6OoT6UU4aw4+zjRVWFthJLDvPGQxe+d75v1oAl/Yw84MD Qvog== X-Gm-Message-State: AOJu0YyzUkztYDYOv+9OhX82kUIqC8DPhWpjaqg6ZMv0JeTFa6L2iWDY SXIT5nEIu93x1H46UfLW7QUXVFM4h/ZqYvrlq0HFUFN0MEIevjQ3U0qdlg== X-Google-Smtp-Source: AGHT+IGq34DMNTXr/TeN+8+Qz7tfQFziaTAqhttRtrfFbxcwZ5cYmjgUbIGzmkpT48+EYMVRx6/fCA== X-Received: by 2002:a05:6512:3a8d:b0:52f:413:30de with SMTP id 2adb3069b0e04-5331c6e436cmr64396e87.7.1723743857987; Thu, 15 Aug 2024 10:44:17 -0700 (PDT) Original-Received: from erwin (87-205-2-211.static.ip.netia.com.pl. [87.205.2.211]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838c6ad0sm131837266b.24.2024.08.15.10.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 10:44:17 -0700 (PDT) In-Reply-To: <86a5hd7o4t.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWjgIPUupJ7V0jLrom4gmjPs42bY0MdFRLHgE5UPDCbfGm9mH6qmkAJAAACNUlEQVQ4y23SMW/aQBQHcKtb2Zx0abZeIxuTCSELJVmiinboRpGHJktloROQzUQcB2vUXFe35XBYUicRAiYUVSjfru/d+QwlnDz5p/97z+dnVcw5WVQ2zxpcdrQTTiIin3bB6lcaTnaBO5c8eoJG2yBl5El+Ob3fglMW3RUIkQ9xxQ8UBEFQafiVZ/5wZqWExM+LvwEegAY856xZO7MgQkq3jxpO56GXxO5VDQAjpVmWqPLYoSGvIahIuvAVHLeEEDd9DRYAkUcKzscAUgCQ0hwSKBOExuh7kvQQUskY4yjsHqeaCfFjLK6x1AzeeyiRD/C1JW5aGqw5IS5mZre+FVz0RVtoUGPJmBCP/4QPJGKUA1oEMJwAHIv+JljYZYCJi1FRQS2DaUw6sgsQTMfb0Fz9RvjyP3iR01x9RGj0N6HgcefS819CSjidDwIFPSFEDgRg1tUw2oBXAB33T2DV63XbM6AqhZzysm3ZcKZrKBAn5O7Q1rAqGoBKNGRsmUG1n0NKaJtd2RnscTWvnom6fGngDaNrCNl728A+c2gLQP8PFpkEjNWjlGqQfPEhWRqoInSyi2p+drsGDjhAeAeSQI8kfjSwbwCn8gblvIftInzT30HdQT2HlU4gwCbLSQ7VFqVEA0RCtjTwtnjdLlkasNjQwF7x02F2iQSL8XIGB8 VQ71WBKHHf5XCIgLUUtIcGSBPhdZIQorpEBrxsqT3GYgRpmicIqrsEgSZm3FG+iJbHYid0/wGj+iTGCXRsqQAAAABJRU5ErkJggg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290186 Archived-At: >> From: Michal Nazarewicz >> Date: Thu, 15 Aug 2024 17:41:03 +0200 >>=20 >> I=E2=80=99m getting the same warning on Linux with Emacs 31.0.50 and it= =E2=80=99s not >> caused by a crash. >>=20 >> emacs> M-x find-file RET /o/foo RET blah RET >> cli> $ ls -l /o/.#foo=20 >> cli> -rw------- 1 mpn mpn 0 2024-08-15 16:30 /o/.#foo >> emacs> M-x save-buffer RET >> emacs> =E2=9B=94 Warning (unlock-file): Unlocking file: Invalid argu= ment, /o/foo, ignored >> cli> $ $ ls -l /o/.#foo /o/foo >> cli> -rw------- 1 mpn mpn 5 2024-08-15 16:31 /o/foo >> cli> -rw------- 1 mpn mpn 0 2024-08-15 16:30 /o/.#foo >>=20 >> The problem appears to be that /o is a network file-system which does >> not support symbolic links: >>=20 >> $ mount |grep /o >> //192.168.x.x/data on /o type cifs (rw,relatime,vers=3D3.0,cache=3Ds= trict,username=3Dmpn,uid=3D1000,forceuid,gid=3D1000,forcegid,addr=3D192.168= .x.x,file_mode=3D0600,dir_mode=3D0700,soft,nounix,serverino,mapposix,repars= e=3Dnfs,rsize=3D4194304,wsize=3D4194304,bsize=3D1048576,retrans=3D1,echo_in= terval=3D60,actimeo=3D1,closetimeo=3D1,_netdev) >> $ ln -s /o/foo /o/f >> ln: failed to create symbolic link '/o/f': Input/output error >>=20 >> I guess Emacs notices that when it tries to create a lock file and falls >> back to creating a file, but then it assumes it=E2=80=99s a symlink when= trying >> to remove it. On Thu, Aug 15 2024, Eli Zaretskii wrote: > I'm not sure we need to do anything here, either, but maybe Paul > (CC'ed) has other suggestions or ideas. The way I see it, Emacs has created those files so Emacs should clean after itself. Though I=E2=80=99ve looked at it a bit more closely and it= =E2=80=99s weirder than my original guess. symlink(2) creates the file (as in it creates a regular file rather than a symbolic link) and returns EIO. create_lock_file reports an error and does not go into its fallback. This is why the lock file is empty. In the end, the error comes from current_lock_owner as it tries to parse the empty file. The *Warnings* buffer constantly popping up is annoying so I=E2=80=99d love= this to be addressed though to be honest I=E2=80=99m not sure what would be a go= od solution. Though I guess you can also argue this is CIFS bug. --=20 Best regards =E3=83=9F=E3=83=8F=E3=82=A6 =E2=80=9C=F0=9D=93=B6=F0=9D=93=B2=F0=9D=93=B7= =F0=9D=93=AA86=E2=80=9D =E3=83=8A=E3=82=B6=E3=83=AC=E3=83=B4=E3=82=A4=E3=83= =84 =C2=ABIf at first you don=E2=80=99t succeed, give up skydiving=C2=BB