From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 23 10:39:05 2012 Received: (at submit) by debbugs.gnu.org; 23 Mar 2012 14:39:05 +0000 Received: from localhost ([127.0.0.1]:35483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SB5ds-0002B0-Uz for submit@debbugs.gnu.org; Fri, 23 Mar 2012 10:39:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50746) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SB5dc-0002Ad-9F for submit@debbugs.gnu.org; Fri, 23 Mar 2012 10:38:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SB59e-0006DF-DG for submit@debbugs.gnu.org; Fri, 23 Mar 2012 10:07:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB59e-0006DB-A4 for submit@debbugs.gnu.org; Fri, 23 Mar 2012 10:07:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB59Y-0002Kp-2b for bug-coreutils@gnu.org; Fri, 23 Mar 2012 10:07:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SB59L-00063g-VJ for bug-coreutils@gnu.org; Fri, 23 Mar 2012 10:07:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:54247 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB59L-00062X-MJ for bug-coreutils@gnu.org; Fri, 23 Mar 2012 10:07:27 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4710B8FB75 for ; Fri, 23 Mar 2012 15:07:25 +0100 (CET) Date: Fri, 23 Mar 2012 15:07:25 +0100 From: Philipp Thomas To: bug-coreutils@gnu.org Subject: Possible bug in cp from coreutils 6.12 Message-ID: <20120323140724.GG5928@paradies.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: openSUSE - Kernel Linux 3.3.0-rc6-1-desktop x86_64 Organization: SUSE LINUX Products GmbH, =?iso-8859-1?Q?G?= =?iso-8859-1?Q?F=3A_Jeff_Hawn=2C_Jennifer_Guild=2C_Felix_Imend=F6rffer=2C?= =?iso-8859-1?Q?_HRB_21284_=28AG_N=FCrnberg=29?= User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) I copy a file from one NFS export to another NFS export and execute it in the new location, I get a "'Stale NFS file handle' error at the second line "cp submit.sh $submit_sh": Here are the scripts: script.sh: #!/bin/sh submit_sh=$HOME/submit_$$.sh set -x cp submit.sh $submit_sh chmod 751 $submit_sh ssh $submit_sh #touch $HOME/ cp submit.sh $submit_sh chmod 751 $submit_sh ssh $submit_sh submit.sh: #!/bin/sh echo Hello rm -rf $0 A collegue analyzed the problem: The problem is that 'cp' is being clever - too clever. When you run cp submit.sh $submit_sh cp first checks if $submit_sh exists. If it does, it just opens with O_WRONLY | O_TRUNC in particular it doesn't include O_CREAT - after all it doesn't need to. Maybe this is a bug in 'cp', but maybe this is intended behaviour. In any case, when cp check if the file exists, NFS thinks it does. It certainly did recently and as it is caching attributes it assumes that it still does until proven otherwise. Then when cp tries to open, it finds out that the file does exist, and reports either "Stale NFS file handle" or "No such file or directory" - I've seen both errors. There is nothing that can be done in the NFS code to "fix" this except to turn off attribute cache. What is effectively happening is the file is disappearing between the 'lstat' and the 'open' and cp doesn't cope. Options: - file a bug report against 'cp' suggesting that if the open fails, then it should retry using O_CREAT. - don't use cp, just "cat submit.sh > $submit_sh" or similar. - use the "--remove-destination" argument to "cp". This will cause it to remove the file (which might fail but that is ignored) before it tries to create it. This was with cp from coreutils 6.12 on SLES11 SP1 and I didn't have time yet to recheck with current coreutils. Philipp From debbugs-submit-bounces@debbugs.gnu.org Tue May 08 05:15:57 2012 Received: (at control) by debbugs.gnu.org; 8 May 2012 09:15:57 +0000 Received: from localhost ([127.0.0.1]:40454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRgWT-0006TP-JK for submit@debbugs.gnu.org; Tue, 08 May 2012 05:15:57 -0400 Received: from mx.meyering.net ([88.168.87.75]:49143) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRgWS-0006TI-5q for control@debbugs.gnu.org; Tue, 08 May 2012 05:15:56 -0400 Received: from rho.meyering.net (localhost.localdomain [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id C1C35603C7 for ; Tue, 8 May 2012 11:13:49 +0200 (CEST) From: Jim Meyering To: control@debbugs.gnu.org Subject: merging 11074 and 11100 Date: Tue, 08 May 2012 11:13:49 +0200 Message-ID: <8762c79gs2.fsf@rho.meyering.net> Lines: 5 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) forcemerge 11074 11100 thanks 11074 and 11100 are essentially equivalent, so now that 11100 is fixed, so is 11074. From debbugs-submit-bounces@debbugs.gnu.org Tue May 08 05:18:31 2012 Received: (at 11074-done) by debbugs.gnu.org; 8 May 2012 09:18:31 +0000 Received: from localhost ([127.0.0.1]:40474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRgYx-0006YC-4p for submit@debbugs.gnu.org; Tue, 08 May 2012 05:18:31 -0400 Received: from mx.meyering.net ([88.168.87.75]:49160) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRgYv-0006Y5-V9 for 11074-done@debbugs.gnu.org; Tue, 08 May 2012 05:18:30 -0400 Received: from rho.meyering.net (localhost.localdomain [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id 4B98560095; Tue, 8 May 2012 11:16:20 +0200 (CEST) From: Jim Meyering To: Philipp Thomas Subject: Re: bug#11074: Possible bug in cp from coreutils 6.12 In-Reply-To: <20120323140724.GG5928@paradies.suse.de> (Philipp Thomas's message of "Fri, 23 Mar 2012 15:07:25 +0100") References: <20120323140724.GG5928@paradies.suse.de> Date: Tue, 08 May 2012 11:16:20 +0200 Message-ID: <87zk9j823f.fsf@rho.meyering.net> Lines: 8 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11074-done Cc: 11074-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Philipp Thomas wrote: > I copy a file from one NFS export to another NFS export and execute > it in the new location, I get a "'Stale NFS file handle' error at the second > line "cp submit.sh $submit_sh": Thanks. I'm marking this as closed, since the fix for http://bugs.gnu.org/11100 should address this problem, too. From unknown Fri Jun 20 07:19:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Jun 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 18 11:33:22 2021 Received: (at control) by debbugs.gnu.org; 18 Nov 2021 16:33:22 +0000 Received: from localhost ([127.0.0.1]:36999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnkLi-0008Tk-AW for submit@debbugs.gnu.org; Thu, 18 Nov 2021 11:33:22 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnkLg-0008TT-AH for control@debbugs.gnu.org; Thu, 18 Nov 2021 11:33:21 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0E5FA1600D1 for ; Thu, 18 Nov 2021 08:33:14 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id I-yTH00cVT-V for ; Thu, 18 Nov 2021 08:33:13 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 70D211600ED for ; Thu, 18 Nov 2021 08:33:13 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RN5b2OqQQVLM for ; Thu, 18 Nov 2021 08:33:13 -0800 (PST) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 511451600D1 for ; Thu, 18 Nov 2021 08:33:13 -0800 (PST) Message-ID: Date: Thu, 18 Nov 2021 08:33:12 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Content-Language: en-US To: control@debbugs.gnu.org From: Paul Eggert Subject: 11100 needs more mail Organization: UCLA Computer Science Department Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) unarchive 11100 From unknown Fri Jun 20 07:19:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 17 Dec 2021 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator