From patchwork Fri Feb 1 17:19:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 217528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "aserp1040.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 229132C0095 for ; Sat, 2 Feb 2013 04:20:09 +1100 (EST) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r11HK6vW024386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Feb 2013 17:20:07 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r11HK6RJ017496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Feb 2013 17:20:06 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1U1KHW-0006by-DM; Fri, 01 Feb 2013 09:20:06 -0800 Received: from aserp1030.oracle.com ([141.146.126.68]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1U1KHK-0006bG-5P for fedfs-utils-devel@oss.oracle.com; Fri, 01 Feb 2013 09:19:54 -0800 Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com [209.85.223.174]) by aserp1030.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r11HJr4G009012 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 1 Feb 2013 17:19:53 GMT Received: by mail-ie0-f174.google.com with SMTP id k10so3608840iea.5 for ; Fri, 01 Feb 2013 09:19:53 -0800 (PST) X-Received: by 10.50.171.42 with SMTP id ar10mr1802385igc.64.1359739193215; Fri, 01 Feb 2013 09:19:53 -0800 (PST) Received: from seurat.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id iw5sm2497192igc.5.2013.02.01.09.19.52 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 01 Feb 2013 09:19:52 -0800 (PST) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Fri, 01 Feb 2013 12:19:51 -0500 Message-ID: <20130201171951.63192.91952.stgit@seurat.1015granger.net> In-Reply-To: <20130201171714.63192.68358.stgit@seurat.1015granger.net> References: <20130201171714.63192.68358.stgit@seurat.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Flow-Control-Info: class=Default reputation=ipRepBelow100 ip=209.85.223.174 ct-class=R5 ct-vol1=0 ct-vol2=8 ct-vol3=8 ct-risk=47 ct-spam1=76 ct-spam2=5 ct-bulk=5 rcpts=1 size=1644 X-MM-CT-Classification: not spam X-MM-CT-RefID: str=0001.0A090201.510BF93A.0009, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Subject: [fedfs-utils] [PATCH 01/13] libjunction: Restore mode bits when deleting junction metadata X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] Deleting junction metadata is supposed to restore a directory's previous mode bits. Or at the very least, the sticky bit should be removed to prevent the kernel from treating this directory like a junction. "nfsref remove" currently doesn't do this. The problem is that the {fedfs,nfs}_delete_junction() twins do not restore the previous mode bits. These should both call junction_restore_mode(). This breakage was introduced in 0.9-devel by commit b01b24fd "libjunction: Deprecate trusted.junction.type xattr", Thu Oct 11 14:59:50 2012, which incorrectly removed call sites for the junction_restore_mode() function. Signed-off-by: Chuck Lever --- src/libjunction/fedfs.c | 4 ++++ src/libjunction/nfs.c | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/libjunction/fedfs.c b/src/libjunction/fedfs.c index eed51b3..a06298a 100644 --- a/src/libjunction/fedfs.c +++ b/src/libjunction/fedfs.c @@ -352,6 +352,10 @@ fedfs_delete_junction(const char *pathname) if (retval != FEDFS_OK) return retval; + retval = junction_restore_mode(pathname); + if (retval != FEDFS_OK) + return retval; + return fedfs_remove_fsn(pathname); } diff --git a/src/libjunction/nfs.c b/src/libjunction/nfs.c index b6bac49..42c1015 100644 --- a/src/libjunction/nfs.c +++ b/src/libjunction/nfs.c @@ -802,6 +802,10 @@ nfs_delete_junction(const char *pathname) if (retval != FEDFS_OK) return retval; + retval = junction_restore_mode(pathname); + if (retval != FEDFS_OK) + return retval; + return nfs_remove_locations(pathname); }