From patchwork Thu Aug 5 14:18:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 117299 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o75EIkoG005656 for ; Thu, 5 Aug 2010 14:18:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760574Ab0HEOSq (ORCPT ); Thu, 5 Aug 2010 10:18:46 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.121]:51208 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760585Ab0HEOSp (ORCPT ); Thu, 5 Aug 2010 10:18:45 -0400 X-Authority-Analysis: v=1.1 cv=h4ObEaoJZLTM5SHWQDGs6q0qkqdOOP/6S5wPMauIuKo= c=1 sm=0 a=4Uf1Qa7vKu4A:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=SiXOXdnYAmaPOjxGfsIA:9 a=4uFGlOKe4LnDtDNWgTUA:7 a=dp-C_wpgVHcQ9t067zYulyiCtpMA:4 a=jEp0ucaQiEUA:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:44395] helo=mail.poochiereds.net) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 83/1D-16283-C38CA5C4; Thu, 05 Aug 2010 14:18:36 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 48DFE58139; Thu, 5 Aug 2010 10:18:36 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH 3/3] cifs: eliminate redundant xdev check in cifs_rename Date: Thu, 5 Aug 2010 10:18:36 -0400 Message-Id: <1281017916-31380-4-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.2 In-Reply-To: <1281017916-31380-1-git-send-email-jlayton@redhat.com> References: <1281017916-31380-1-git-send-email-jlayton@redhat.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 05 Aug 2010 14:18:46 +0000 (UTC) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 5905f4c..3f94a56 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1468,29 +1468,18 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, { char *fromName = NULL; char *toName = NULL; - struct cifs_sb_info *cifs_sb_source; - struct cifs_sb_info *cifs_sb_target; + struct cifs_sb_info *cifs_sb; struct cifsTconInfo *tcon; FILE_UNIX_BASIC_INFO *info_buf_source = NULL; FILE_UNIX_BASIC_INFO *info_buf_target; int xid, rc, tmprc; - cifs_sb_target = CIFS_SB(target_dir->i_sb); - cifs_sb_source = CIFS_SB(source_dir->i_sb); - tcon = cifs_sb_source->tcon; + cifs_sb = CIFS_SB(source_dir->i_sb); + tcon = cifs_sb->tcon; xid = GetXid(); /* - * BB: this might be allowed if same server, but different share. - * Consider adding support for this - */ - if (tcon != cifs_sb_target->tcon) { - rc = -EXDEV; - goto cifs_rename_exit; - } - - /* * we already have the rename sem so we do not need to * grab it again here to protect the path integrity */ @@ -1525,17 +1514,16 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, info_buf_target = info_buf_source + 1; tmprc = CIFSSMBUnixQPathInfo(xid, tcon, fromName, info_buf_source, - cifs_sb_source->local_nls, - cifs_sb_source->mnt_cifs_flags & + cifs_sb->local_nls, + cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (tmprc != 0) goto unlink_target; - tmprc = CIFSSMBUnixQPathInfo(xid, tcon, - toName, info_buf_target, - cifs_sb_target->local_nls, - /* remap based on source sb */ - cifs_sb_source->mnt_cifs_flags & + tmprc = CIFSSMBUnixQPathInfo(xid, tcon, toName, + info_buf_target, + cifs_sb->local_nls, + cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (tmprc == 0 && (info_buf_source->UniqueId ==