aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 4bc47e5b5f29..93f77d438d3c 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -834,7 +834,7 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino)
834 xid, NULL); 834 xid, NULL);
835 835
836 if (!inode) 836 if (!inode)
837 return ERR_PTR(-ENOMEM); 837 return ERR_PTR(rc);
838 838
839#ifdef CONFIG_CIFS_FSCACHE 839#ifdef CONFIG_CIFS_FSCACHE
840 /* populate tcon->resource_id */ 840 /* populate tcon->resource_id */
@@ -1462,29 +1462,18 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
1462{ 1462{
1463 char *fromName = NULL; 1463 char *fromName = NULL;
1464 char *toName = NULL; 1464 char *toName = NULL;
1465 struct cifs_sb_info *cifs_sb_source; 1465 struct cifs_sb_info *cifs_sb;
1466 struct cifs_sb_info *cifs_sb_target;
1467 struct cifsTconInfo *tcon; 1466 struct cifsTconInfo *tcon;
1468 FILE_UNIX_BASIC_INFO *info_buf_source = NULL; 1467 FILE_UNIX_BASIC_INFO *info_buf_source = NULL;
1469 FILE_UNIX_BASIC_INFO *info_buf_target; 1468 FILE_UNIX_BASIC_INFO *info_buf_target;
1470 int xid, rc, tmprc; 1469 int xid, rc, tmprc;
1471 1470
1472 cifs_sb_target = CIFS_SB(target_dir->i_sb); 1471 cifs_sb = CIFS_SB(source_dir->i_sb);
1473 cifs_sb_source = CIFS_SB(source_dir->i_sb); 1472 tcon = cifs_sb->tcon;
1474 tcon = cifs_sb_source->tcon;
1475 1473
1476 xid = GetXid(); 1474 xid = GetXid();
1477 1475
1478 /* 1476 /*
1479 * BB: this might be allowed if same server, but different share.
1480 * Consider adding support for this
1481 */
1482 if (tcon != cifs_sb_target->tcon) {
1483 rc = -EXDEV;
1484 goto cifs_rename_exit;
1485 }
1486
1487 /*
1488 * we already have the rename sem so we do not need to 1477 * we already have the rename sem so we do not need to
1489 * grab it again here to protect the path integrity 1478 * grab it again here to protect the path integrity
1490 */ 1479 */
@@ -1519,17 +1508,16 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
1519 info_buf_target = info_buf_source + 1; 1508 info_buf_target = info_buf_source + 1;
1520 tmprc = CIFSSMBUnixQPathInfo(xid, tcon, fromName, 1509 tmprc = CIFSSMBUnixQPathInfo(xid, tcon, fromName,
1521 info_buf_source, 1510 info_buf_source,
1522 cifs_sb_source->local_nls, 1511 cifs_sb->local_nls,
1523 cifs_sb_source->mnt_cifs_flags & 1512 cifs_sb->mnt_cifs_flags &
1524 CIFS_MOUNT_MAP_SPECIAL_CHR); 1513 CIFS_MOUNT_MAP_SPECIAL_CHR);
1525 if (tmprc != 0) 1514 if (tmprc != 0)
1526 goto unlink_target; 1515 goto unlink_target;
1527 1516
1528 tmprc = CIFSSMBUnixQPathInfo(xid, tcon, 1517 tmprc = CIFSSMBUnixQPathInfo(xid, tcon, toName,
1529 toName, info_buf_target, 1518 info_buf_target,
1530 cifs_sb_target->local_nls, 1519 cifs_sb->local_nls,
1531 /* remap based on source sb */ 1520 cifs_sb->mnt_cifs_flags &
1532 cifs_sb_source->mnt_cifs_flags &
1533 CIFS_MOUNT_MAP_SPECIAL_CHR); 1521 CIFS_MOUNT_MAP_SPECIAL_CHR);
1534 1522
1535 if (tmprc == 0 && (info_buf_source->UniqueId == 1523 if (tmprc == 0 && (info_buf_source->UniqueId ==