From patchwork Thu Oct 11 19:09:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 190977 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "rcsinet15.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8B1552C008E for ; Fri, 12 Oct 2012 06:09:40 +1100 (EST) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q9BJ9bfU000608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Oct 2012 19:09:37 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 q9BJ9ate011056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Oct 2012 19:09:37 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1TMO8W-0004XH-NO; Thu, 11 Oct 2012 12:09:36 -0700 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1TMO8U-0004X4-IN for fedfs-utils-devel@oss.oracle.com; Thu, 11 Oct 2012 12:09:34 -0700 Received: from acsinet12.oracle.com (acsinet12.oracle.com [141.146.126.234]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q9BJ9YsQ008900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Oct 2012 19:09:34 GMT Received: from mail-ia0-f171.google.com (mail-ia0-f171.google.com [209.85.210.171]) by acsinet12.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q9BJ97sk028760 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 11 Oct 2012 19:09:33 GMT Received: by mail-ia0-f171.google.com with SMTP id u21so1611160ial.2 for ; Thu, 11 Oct 2012 12:09:32 -0700 (PDT) Received: by 10.50.183.202 with SMTP id eo10mr1945316igc.38.1349982572651; Thu, 11 Oct 2012 12:09:32 -0700 (PDT) Received: from seurat.1015granger.net ([99.26.161.222]) by mx.google.com with ESMTPS id qn3sm25478igc.7.2012.10.11.12.09.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 12:09:32 -0700 (PDT) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Thu, 11 Oct 2012 15:09:31 -0400 Message-ID: <20121011190931.31447.29718.stgit@seurat.1015granger.net> In-Reply-To: <20121011190220.31447.12725.stgit@seurat.1015granger.net> References: <20121011190220.31447.12725.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.210.171 ct-class=G1 ct-vol1=0 ct-vol2=0 ct-vol3=0 ct-risk=0 ct-spam1=0 ct-spam2=0 ct-bulk=0 rcpts=1 size=5263 X-MM-CT-Classification: not spam X-MM-CT-RefID: str=0001.0A090205.5077196D.0100,ss=1,re=0.000,fgs=0 Subject: [fedfs-utils] [PATCH 6/8] libjunction: Deprecate trusted.junction.type xattr 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] Since fedfs-utils 0.8, we don't read the contents of this extended attribute, and since Linux kernel 3.0, we no longer even check for the existence of this xattr. It's no longer needed, and support for it can be removed. Signed-off-by: Chuck Lever --- src/libjunction/fedfs.c | 17 +---------- src/libjunction/junction-internal.h | 7 ----- src/libjunction/junction.c | 53 ----------------------------------- src/libjunction/nfs.c | 13 --------- 4 files changed, 1 insertions(+), 89 deletions(-) diff --git a/src/libjunction/fedfs.c b/src/libjunction/fedfs.c index bbd0a65..5acd58e 100644 --- a/src/libjunction/fedfs.c +++ b/src/libjunction/fedfs.c @@ -39,9 +39,7 @@ * "trusted.junction.nfs". The parent object is a directory. * * To help file servers discover junctions efficiently, the directory - * has no execute bits, and the sticky bit is set. In addition, an - * extended attribute called "trusted.junction.type" is added. The - * contents are ignored in user space. + * has no execute bits, and the sticky bit is set. * * Finally, for pre-existing directories that are converted to * junctions, their mode bits are saved in an extended attribute called @@ -291,11 +289,6 @@ fedfs_add_junction(const char *pathname, const char *fsn_uuid, const nsdb_t host if (retval != FEDFS_OK) goto out_err; - /* The content of this attribute is ignored */ - retval = junction_add_type(pathname, "nfs"); - if (retval != FEDFS_OK) - return retval; - return retval; out_err: @@ -321,14 +314,6 @@ fedfs_delete_junction(const char *pathname) if (retval != FEDFS_OK) return retval; - retval = junction_remove_type(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/junction-internal.h b/src/libjunction/junction-internal.h index f362d0d..e80edf0 100644 --- a/src/libjunction/junction-internal.h +++ b/src/libjunction/junction-internal.h @@ -39,11 +39,6 @@ #define JUNCTION_XATTR_NAME_MODE "trusted.junction.mode" /** - * Name of extended attribute containing junction type - */ -#define JUNCTION_XATTR_NAME_TYPE "trusted.junction.type" - -/** * Name of extended attribute containing NFS-related junction data */ #define JUNCTION_XATTR_NAME_NFS "trusted.junction.nfs" @@ -84,8 +79,6 @@ FedFsStatus junction_remove_xattr(int fd, const char *pathname, const char *name); FedFsStatus junction_save_mode(const char *pathname); FedFsStatus junction_restore_mode(const char *pathname); -FedFsStatus junction_add_type(const char *pathname, const char *type); -FedFsStatus junction_remove_type(const char *pathname); /** diff --git a/src/libjunction/junction.c b/src/libjunction/junction.c index baf7a90..cd53744 100644 --- a/src/libjunction/junction.c +++ b/src/libjunction/junction.c @@ -465,56 +465,3 @@ out: (void)close(fd); return retval; } - -/** - * Add the TYPE xattr - * - * @param pathname NUL-terminated C string containing pathname of a directory - * @param type NUL-terminated C string containing the contents of the new xattr - * @return a FedFsStatus code - * - * @note Access to trusted attributes requires CAP_SYS_ADMIN. - * - * The TYPE xattr is read by local file servers to know when they should - * perform junction resolution. - */ -FedFsStatus -junction_add_type(const char *pathname, const char *type) -{ - FedFsStatus retval; - int fd; - - retval = junction_open_path(pathname, &fd); - if (retval != FEDFS_OK) - return retval; - - retval = junction_set_xattr(fd, pathname, JUNCTION_XATTR_NAME_TYPE, - type, strlen(type) + 1); - - (void)close(fd); - return retval; -} - -/** - * Remove the TYPE xattr - * - * @param pathname NUL-terminated C string containing pathname of a directory - * @return a FedFsStatus code - * - * @note Access to trusted attributes requires CAP_SYS_ADMIN. - */ -FedFsStatus -junction_remove_type(const char *pathname) -{ - FedFsStatus retval; - int fd; - - retval = junction_open_path(pathname, &fd); - if (retval != FEDFS_OK) - return retval; - - retval = junction_remove_xattr(fd, pathname, JUNCTION_XATTR_NAME_TYPE); - - (void)close(fd); - return retval; -} diff --git a/src/libjunction/nfs.c b/src/libjunction/nfs.c index f47d848..67c434c 100644 --- a/src/libjunction/nfs.c +++ b/src/libjunction/nfs.c @@ -813,11 +813,6 @@ nfs_add_junction(const char *pathname, struct nfs_fsloc *fslocs) if (retval != FEDFS_OK) goto out_err; - /* The content of this attribute is ignored */ - retval = junction_add_type(pathname, "nfs"); - if (retval != FEDFS_OK) - return retval; - return retval; out_err: @@ -843,14 +838,6 @@ nfs_delete_junction(const char *pathname) if (retval != FEDFS_OK) return retval; - retval = junction_remove_type(pathname); - if (retval != FEDFS_OK) - return retval; - - retval = junction_restore_mode(pathname); - if (retval != FEDFS_OK) - return retval; - return nfs_remove_locations(pathname); }