From owner-freebsd-stable@FreeBSD.ORG Thu Oct 27 15:00:10 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3B0E106564A for ; Thu, 27 Oct 2011 15:00:10 +0000 (UTC) (envelope-from citrin@citrin.ru) Received: from mail-chaos.rambler.ru (mail-chaos.rambler.ru [81.19.68.130]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6B98FC12 for ; Thu, 27 Oct 2011 15:00:10 +0000 (UTC) Received: from citrin.office.vega.ru (office-nat.spylog.net [193.169.234.6]) (Authenticated sender: citrin@citrin.ru) by mail-chaos.rambler.ru (Postfix) with ESMTPSA id 0591D1702A for ; Thu, 27 Oct 2011 18:48:58 +0400 (MSD) Message-ID: <4EA96F59.7040308@citrin.ru> Date: Thu, 27 Oct 2011 18:48:57 +0400 From: Anton Yuzhaninov User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:6.0.2) Gecko/20110922 Thunderbird/6.0.2 MIME-Version: 1.0 To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: FreeBSD 8 - bug in rename(2) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2011 15:00:10 -0000 After upgrade from old RELENG_7 to fresh RELENG_8 I've met with error in log rotation script. After some digging I'v found, that rename(2) syscall sometime don't work properly. I can't reproduce problem with simple test case, but in production this problem appeared several time per day. After rename(2) sometimes old name still exists. stat for old and new names: 101 12153947 -rw-r--r-- 1 owner data 54507160 164374900 "Oct 27 13:58:06 2011" "Oct 27 13:58:06 2011" "Oct 27 13:58:06 2011" "Oct 27 13:56:05 2011" 16384 321248 0 /usr/local/run/nginx/access_log 101 12153947 -rw-r--r-- 1 owner data 54507160 164377726 "Oct 27 13:58:06 2011" "Oct 27 13:58:06 2011" "Oct 27 13:58:06 2011" "Oct 27 13:56:05 2011" 16384 321248 0 /usr/local/run/nginx/access_log.20111027T135806 2 files share same inode, but number of links is 1 2-nd rename for this file fail: mv: rename /usr/local/run/nginx/access_log to /usr/local/run/nginx/access_log.tmp: No such file or directory vfs.lookup_shared=0 don't affect this problem, It seems to be, that problem is related to namei (vfs) cache - old entry sometimes is not removed. Renamed file is open for write by nginx, but I don't know how this can affect namei. -- Anton Yuzhaninov