]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
authorSteve French <sfrench@us.ibm.com>
Thu, 13 May 2010 22:19:32 +0000 (22:19 +0000)
committerSteve French <sfrench@us.ibm.com>
Thu, 13 May 2010 22:19:32 +0000 (22:19 +0000)
Conflicts:
fs/cifs/inode.c

1  2 
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/inode.c

diff --combined fs/cifs/cifsfs.c
index 833166372a081cd054d6169178bc93f151675319,ad235d604a0b8f123b869bc5c80df55d5b5642fc..78c02eb4cb1f107f6c2503acc4f6d56f7e1b1524
  #include "cifs_spnego.h"
  #define CIFS_MAGIC_NUMBER 0xFF534D42  /* the first four bytes of SMB PDUs */
  
 -#ifdef CONFIG_CIFS_QUOTA
 -static const struct quotactl_ops cifs_quotactl_ops;
 -#endif /* QUOTA */
 -
  int cifsFYI = 0;
  int cifsERROR = 1;
  int traceSMB = 0;
@@@ -57,7 -61,7 +57,7 @@@ unsigned int experimEnabled = 0
  unsigned int linuxExtEnabled = 1;
  unsigned int lookupCacheEnabled = 1;
  unsigned int multiuser_mount = 0;
 -unsigned int extended_security = CIFSSEC_DEF;
 +unsigned int global_secflags = CIFSSEC_DEF;
  /* unsigned int ntlmv2_support = 0; */
  unsigned int sign_CIFS_PDUs = 1;
  static const struct super_operations cifs_super_ops;
@@@ -82,6 -86,8 +82,6 @@@ extern mempool_t *cifs_sm_req_poolp
  extern mempool_t *cifs_req_poolp;
  extern mempool_t *cifs_mid_poolp;
  
 -extern struct kmem_cache *cifs_oplock_cachep;
 -
  static int
  cifs_read_super(struct super_block *sb, void *data,
                const char *devname, int silent)
        if (cifs_sb == NULL)
                return -ENOMEM;
  
+       rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY);
+       if (rc) {
+               kfree(cifs_sb);
+               return rc;
+       }
  #ifdef CONFIG_CIFS_DFS_UPCALL
        /* copy mount params to sb for use in submounts */
        /* BB: should we move this after the mount so we
                int len = strlen(data);
                cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
                if (cifs_sb->mountdata == NULL) {
+                       bdi_destroy(&cifs_sb->bdi);
                        kfree(sb->s_fs_info);
                        sb->s_fs_info = NULL;
                        return -ENOMEM;
  
        if (rc) {
                if (!silent)
 -                      cERROR(1,
 -                             ("cifs_mount failed w/return code = %d", rc));
 +                      cERROR(1, "cifs_mount failed w/return code = %d", rc);
                goto out_mount_failed;
        }
  
        sb->s_magic = CIFS_MAGIC_NUMBER;
        sb->s_op = &cifs_super_ops;
+       sb->s_bdi = &cifs_sb->bdi;
  /*    if (cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512)
            sb->s_blocksize =
                cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */
 -#ifdef CONFIG_CIFS_QUOTA
 -      sb->s_qcop = &cifs_quotactl_ops;
 -#endif
        sb->s_blocksize = CIFS_MAX_MSGSIZE;
        sb->s_blocksize_bits = 14;      /* default 2**14 = CIFS_MAX_MSGSIZE */
        inode = cifs_root_iget(sb, ROOT_I);
  
  #ifdef CONFIG_CIFS_EXPERIMENTAL
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
 -              cFYI(1, ("export ops supported"));
 +              cFYI(1, "export ops supported");
                sb->s_export_op = &cifs_export_ops;
        }
  #endif /* EXPERIMENTAL */
        return 0;
  
  out_no_root:
 -      cERROR(1, ("cifs_read_super: get root inode failed"));
 +      cERROR(1, "cifs_read_super: get root inode failed");
        if (inode)
                iput(inode);
  
@@@ -173,6 -191,7 +181,7 @@@ out_mount_failed
                }
  #endif
                unload_nls(cifs_sb->local_nls);
+               bdi_destroy(&cifs_sb->bdi);
                kfree(cifs_sb);
        }
        return rc;
@@@ -184,10 -203,10 +193,10 @@@ cifs_put_super(struct super_block *sb
        int rc = 0;
        struct cifs_sb_info *cifs_sb;
  
 -      cFYI(1, ("In cifs_put_super"));
 +      cFYI(1, "In cifs_put_super");
        cifs_sb = CIFS_SB(sb);
        if (cifs_sb == NULL) {
 -              cFYI(1, ("Empty cifs superblock info passed to unmount"));
 +              cFYI(1, "Empty cifs superblock info passed to unmount");
                return;
        }
  
  
        rc = cifs_umount(sb, cifs_sb);
        if (rc)
 -              cERROR(1, ("cifs_umount failed with return code %d", rc));
 +              cERROR(1, "cifs_umount failed with return code %d", rc);
  #ifdef CONFIG_CIFS_DFS_UPCALL
        if (cifs_sb->mountdata) {
                kfree(cifs_sb->mountdata);
  #endif
  
        unload_nls(cifs_sb->local_nls);
+       bdi_destroy(&cifs_sb->bdi);
        kfree(cifs_sb);
  
        unlock_kernel();
@@@ -280,6 -300,7 +290,6 @@@ static int cifs_permission(struct inod
  static struct kmem_cache *cifs_inode_cachep;
  static struct kmem_cache *cifs_req_cachep;
  static struct kmem_cache *cifs_mid_cachep;
 -struct kmem_cache *cifs_oplock_cachep;
  static struct kmem_cache *cifs_sm_req_cachep;
  mempool_t *cifs_sm_req_poolp;
  mempool_t *cifs_req_poolp;
@@@ -411,6 -432,106 +421,6 @@@ cifs_show_options(struct seq_file *s, s
        return 0;
  }
  
 -#ifdef CONFIG_CIFS_QUOTA
 -int cifs_xquota_set(struct super_block *sb, int quota_type, qid_t qid,
 -              struct fs_disk_quota *pdquota)
 -{
 -      int xid;
 -      int rc = 0;
 -      struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
 -      struct cifsTconInfo *pTcon;
 -
 -      if (cifs_sb)
 -              pTcon = cifs_sb->tcon;
 -      else
 -              return -EIO;
 -
 -
 -      xid = GetXid();
 -      if (pTcon) {
 -              cFYI(1, ("set type: 0x%x id: %d", quota_type, qid));
 -      } else
 -              rc = -EIO;
 -
 -      FreeXid(xid);
 -      return rc;
 -}
 -
 -int cifs_xquota_get(struct super_block *sb, int quota_type, qid_t qid,
 -                  struct fs_disk_quota *pdquota)
 -{
 -      int xid;
 -      int rc = 0;
 -      struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
 -      struct cifsTconInfo *pTcon;
 -
 -      if (cifs_sb)
 -              pTcon = cifs_sb->tcon;
 -      else
 -              return -EIO;
 -
 -      xid = GetXid();
 -      if (pTcon) {
 -              cFYI(1, ("set type: 0x%x id: %d", quota_type, qid));
 -      } else
 -              rc = -EIO;
 -
 -      FreeXid(xid);
 -      return rc;
 -}
 -
 -int cifs_xstate_set(struct super_block *sb, unsigned int flags, int operation)
 -{
 -      int xid;
 -      int rc = 0;
 -      struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
 -      struct cifsTconInfo *pTcon;
 -
 -      if (cifs_sb)
 -              pTcon = cifs_sb->tcon;
 -      else
 -              return -EIO;
 -
 -      xid = GetXid();
 -      if (pTcon) {
 -              cFYI(1, ("flags: 0x%x operation: 0x%x", flags, operation));
 -      } else
 -              rc = -EIO;
 -
 -      FreeXid(xid);
 -      return rc;
 -}
 -
 -int cifs_xstate_get(struct super_block *sb, struct fs_quota_stat *qstats)
 -{
 -      int xid;
 -      int rc = 0;
 -      struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
 -      struct cifsTconInfo *pTcon;
 -
 -      if (cifs_sb)
 -              pTcon = cifs_sb->tcon;
 -      else
 -              return -EIO;
 -
 -      xid = GetXid();
 -      if (pTcon) {
 -              cFYI(1, ("pqstats %p", qstats));
 -      } else
 -              rc = -EIO;
 -
 -      FreeXid(xid);
 -      return rc;
 -}
 -
 -static const struct quotactl_ops cifs_quotactl_ops = {
 -      .set_xquota     = cifs_xquota_set,
 -      .get_xquota     = cifs_xquota_get,
 -      .set_xstate     = cifs_xstate_set,
 -      .get_xstate     = cifs_xstate_get,
 -};
 -#endif
 -
  static void cifs_umount_begin(struct super_block *sb)
  {
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
        /* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
        /* cancel_notify_requests(tcon); */
        if (tcon->ses && tcon->ses->server) {
 -              cFYI(1, ("wake up tasks now - umount begin not complete"));
 +              cFYI(1, "wake up tasks now - umount begin not complete");
                wake_up_all(&tcon->ses->server->request_q);
                wake_up_all(&tcon->ses->server->response_q);
                msleep(1); /* yield */
@@@ -488,7 -609,7 +498,7 @@@ cifs_get_sb(struct file_system_type *fs
        int rc;
        struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL);
  
 -      cFYI(1, ("Devname: %s flags: %d ", dev_name, flags));
 +      cFYI(1, "Devname: %s flags: %d ", dev_name, flags);
  
        if (IS_ERR(sb))
                return PTR_ERR(sb);
@@@ -535,6 -656,7 +545,6 @@@ static loff_t cifs_llseek(struct file *
        return generic_file_llseek_unlocked(file, offset, origin);
  }
  
 -#ifdef CONFIG_CIFS_EXPERIMENTAL
  static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
  {
        /* note that this is called by vfs setlease with the BKL held
        else
                return -EAGAIN;
  }
 -#endif
  
  struct file_system_type cifs_fs_type = {
        .owner = THIS_MODULE,
@@@ -639,7 -762,10 +649,7 @@@ const struct file_operations cifs_file_
  #ifdef CONFIG_CIFS_POSIX
        .unlocked_ioctl = cifs_ioctl,
  #endif /* CONFIG_CIFS_POSIX */
 -
 -#ifdef CONFIG_CIFS_EXPERIMENTAL
        .setlease = cifs_setlease,
 -#endif /* CONFIG_CIFS_EXPERIMENTAL */
  };
  
  const struct file_operations cifs_file_direct_ops = {
        .unlocked_ioctl  = cifs_ioctl,
  #endif /* CONFIG_CIFS_POSIX */
        .llseek = cifs_llseek,
 -#ifdef CONFIG_CIFS_EXPERIMENTAL
        .setlease = cifs_setlease,
 -#endif /* CONFIG_CIFS_EXPERIMENTAL */
  };
  const struct file_operations cifs_file_nobrl_ops = {
        .read = do_sync_read,
  #ifdef CONFIG_CIFS_POSIX
        .unlocked_ioctl = cifs_ioctl,
  #endif /* CONFIG_CIFS_POSIX */
 -
 -#ifdef CONFIG_CIFS_EXPERIMENTAL
        .setlease = cifs_setlease,
 -#endif /* CONFIG_CIFS_EXPERIMENTAL */
  };
  
  const struct file_operations cifs_file_direct_nobrl_ops = {
        .unlocked_ioctl  = cifs_ioctl,
  #endif /* CONFIG_CIFS_POSIX */
        .llseek = cifs_llseek,
 -#ifdef CONFIG_CIFS_EXPERIMENTAL
        .setlease = cifs_setlease,
 -#endif /* CONFIG_CIFS_EXPERIMENTAL */
  };
  
  const struct file_operations cifs_dir_ops = {
@@@ -745,7 -878,7 +755,7 @@@ cifs_init_request_bufs(void
        } else {
                CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/
        }
 -/*    cERROR(1,("CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize)); */
 +/*    cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */
        cifs_req_cachep = kmem_cache_create("cifs_request",
                                            CIFSMaxBufSize +
                                            MAX_CIFS_HDR_SIZE, 0,
                cifs_min_rcv = 1;
        else if (cifs_min_rcv > 64) {
                cifs_min_rcv = 64;
 -              cERROR(1, ("cifs_min_rcv set to maximum (64)"));
 +              cERROR(1, "cifs_min_rcv set to maximum (64)");
        }
  
        cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
                cifs_min_small = 2;
        else if (cifs_min_small > 256) {
                cifs_min_small = 256;
 -              cFYI(1, ("cifs_min_small set to maximum (256)"));
 +              cFYI(1, "cifs_min_small set to maximum (256)");
        }
  
        cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small,
@@@ -829,6 -962,15 +839,6 @@@ cifs_init_mids(void
                return -ENOMEM;
        }
  
 -      cifs_oplock_cachep = kmem_cache_create("cifs_oplock_structs",
 -                                      sizeof(struct oplock_q_entry), 0,
 -                                      SLAB_HWCACHE_ALIGN, NULL);
 -      if (cifs_oplock_cachep == NULL) {
 -              mempool_destroy(cifs_mid_poolp);
 -              kmem_cache_destroy(cifs_mid_cachep);
 -              return -ENOMEM;
 -      }
 -
        return 0;
  }
  
@@@ -837,6 -979,7 +847,6 @@@ cifs_destroy_mids(void
  {
        mempool_destroy(cifs_mid_poolp);
        kmem_cache_destroy(cifs_mid_cachep);
 -      kmem_cache_destroy(cifs_oplock_cachep);
  }
  
  static int __init
@@@ -876,10 -1019,10 +886,10 @@@ init_cifs(void
  
        if (cifs_max_pending < 2) {
                cifs_max_pending = 2;
 -              cFYI(1, ("cifs_max_pending set to min of 2"));
 +              cFYI(1, "cifs_max_pending set to min of 2");
        } else if (cifs_max_pending > 256) {
                cifs_max_pending = 256;
 -              cFYI(1, ("cifs_max_pending set to max of 256"));
 +              cFYI(1, "cifs_max_pending set to max of 256");
        }
  
        rc = cifs_init_inodecache();
  static void __exit
  exit_cifs(void)
  {
 -      cFYI(DBG2, ("exit_cifs"));
 +      cFYI(DBG2, "exit_cifs");
        cifs_proc_clean();
  #ifdef CONFIG_CIFS_DFS_UPCALL
        cifs_dfs_release_automount_timer();
diff --combined fs/cifs/cifsglob.h
index 4a99487400f361527c41de72048821d80a67d25b,0c2fd17439c8c5246fb01e460f46820d3b8eb0c1..a88479ceaad59602919d3d6d1a1c7a01855d69ac
@@@ -87,6 -87,7 +87,6 @@@ enum securityEnum 
        RawNTLMSSP,             /* NTLMSSP without SPNEGO, NTLMv2 hash */
  /*    NTLMSSP, */ /* can use rawNTLMSSP instead of NTLMSSP via SPNEGO */
        Kerberos,               /* Kerberos via SPNEGO */
 -      MSKerberos,             /* MS Kerberos via SPNEGO */
  };
  
  enum protocolEnum {
@@@ -184,12 -185,6 +184,12 @@@ struct TCP_Server_Info 
        struct mac_key mac_signing_key;
        char ntlmv2_hash[16];
        unsigned long lstrp; /* when we got last response from this server */
 +      u16 dialect; /* dialect index that server chose */
 +      /* extended security flavors that server supports */
 +      bool    sec_kerberos;           /* supports plain Kerberos */
 +      bool    sec_mskerberos;         /* supports legacy MS Kerberos */
 +      bool    sec_kerberosu2u;        /* supports U2U Kerberos */
 +      bool    sec_ntlmssp;            /* supports NTLMSSP */
  };
  
  /*
@@@ -507,6 -502,7 +507,7 @@@ struct dfs_info3_param 
  #define CIFS_FATTR_DFS_REFERRAL               0x1
  #define CIFS_FATTR_DELETE_PENDING     0x2
  #define CIFS_FATTR_NEED_REVAL         0x4
+ #define CIFS_FATTR_INO_COLLISION      0x8
  
  struct cifs_fattr {
        u32             cf_flags;
@@@ -722,7 -718,7 +723,7 @@@ GLOBAL_EXTERN unsigned int multiuser_mo
  GLOBAL_EXTERN unsigned int oplockEnabled;
  GLOBAL_EXTERN unsigned int experimEnabled;
  GLOBAL_EXTERN unsigned int lookupCacheEnabled;
 -GLOBAL_EXTERN unsigned int extended_security; /* if on, session setup sent
 +GLOBAL_EXTERN unsigned int global_secflags;   /* if on, session setup sent
                                with more secure ntlmssp2 challenge/resp */
  GLOBAL_EXTERN unsigned int sign_CIFS_PDUs;  /* enable smb packet signing */
  GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/
diff --combined fs/cifs/inode.c
index b35cb031c20cbd965b036c4ce2c4dafd4f84d487,29b9ea244c8132e241f1f9e6749be2003a8f196c..5b042fc4645029cfce2185dbcc61d13668d4300b
@@@ -1,7 -1,7 +1,7 @@@
  /*
   *   fs/cifs/inode.c
   *
 - *   Copyright (C) International Business Machines  Corp., 2002,2008
 + *   Copyright (C) International Business Machines  Corp., 2002,2010
   *   Author(s): Steve French (sfrench@us.ibm.com)
   *
   *   This library is free software; you can redistribute it and/or modify
@@@ -86,30 -86,30 +86,30 @@@ cifs_revalidate_cache(struct inode *ino
  {
        struct cifsInodeInfo *cifs_i = CIFS_I(inode);
  
 -      cFYI(1, ("%s: revalidating inode %llu", __func__, cifs_i->uniqueid));
 +      cFYI(1, "%s: revalidating inode %llu", __func__, cifs_i->uniqueid);
  
        if (inode->i_state & I_NEW) {
 -              cFYI(1, ("%s: inode %llu is new", __func__, cifs_i->uniqueid));
 +              cFYI(1, "%s: inode %llu is new", __func__, cifs_i->uniqueid);
                return;
        }
  
        /* don't bother with revalidation if we have an oplock */
        if (cifs_i->clientCanCacheRead) {
 -              cFYI(1, ("%s: inode %llu is oplocked", __func__,
 -                       cifs_i->uniqueid));
 +              cFYI(1, "%s: inode %llu is oplocked", __func__,
 +                       cifs_i->uniqueid);
                return;
        }
  
         /* revalidate if mtime or size have changed */
        if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) &&
            cifs_i->server_eof == fattr->cf_eof) {
 -              cFYI(1, ("%s: inode %llu is unchanged", __func__,
 -                       cifs_i->uniqueid));
 +              cFYI(1, "%s: inode %llu is unchanged", __func__,
 +                       cifs_i->uniqueid);
                return;
        }
  
 -      cFYI(1, ("%s: invalidating inode %llu mapping", __func__,
 -               cifs_i->uniqueid));
 +      cFYI(1, "%s: invalidating inode %llu mapping", __func__,
 +               cifs_i->uniqueid);
        cifs_i->invalid_mapping = true;
  }
  
@@@ -144,8 -144,8 +144,8 @@@ cifs_fattr_to_inode(struct inode *inode
        else
                cifs_i->time = jiffies;
  
 -      cFYI(1, ("inode 0x%p old_time=%ld new_time=%ld", inode,
 -               oldtime, cifs_i->time));
 +      cFYI(1, "inode 0x%p old_time=%ld new_time=%ld", inode,
 +               oldtime, cifs_i->time);
  
        cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING;
  
@@@ -227,7 -227,7 +227,7 @@@ cifs_unix_basic_to_fattr(struct cifs_fa
                /* safest to call it a file if we do not know */
                fattr->cf_mode |= S_IFREG;
                fattr->cf_dtype = DT_REG;
 -              cFYI(1, ("unknown type %d", le32_to_cpu(info->Type)));
 +              cFYI(1, "unknown type %d", le32_to_cpu(info->Type));
                break;
        }
  
@@@ -256,7 -256,7 +256,7 @@@ cifs_create_dfs_fattr(struct cifs_fatt
  {
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
  
 -      cFYI(1, ("creating fake fattr for DFS referral"));
 +      cFYI(1, "creating fake fattr for DFS referral");
  
        memset(fattr, 0, sizeof(*fattr));
        fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU;
@@@ -305,7 -305,7 +305,7 @@@ int cifs_get_inode_info_unix(struct ino
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
  
        tcon = cifs_sb->tcon;
 -      cFYI(1, ("Getting info on %s", full_path));
 +      cFYI(1, "Getting info on %s", full_path);
  
        /* could have done a find first instead but this returns more info */
        rc = CIFSSMBUnixQPathInfo(xid, tcon, full_path, &find_data,
@@@ -373,7 -373,7 +373,7 @@@ cifs_sfu_type(struct cifs_fattr *fattr
                                 &bytes_read, &pbuf, &buf_type);
                if ((rc == 0) && (bytes_read >= 8)) {
                        if (memcmp("IntxBLK", pbuf, 8) == 0) {
 -                              cFYI(1, ("Block device"));
 +                              cFYI(1, "Block device");
                                fattr->cf_mode |= S_IFBLK;
                                fattr->cf_dtype = DT_BLK;
                                if (bytes_read == 24) {
                                        fattr->cf_rdev = MKDEV(mjr, mnr);
                                }
                        } else if (memcmp("IntxCHR", pbuf, 8) == 0) {
 -                              cFYI(1, ("Char device"));
 +                              cFYI(1, "Char device");
                                fattr->cf_mode |= S_IFCHR;
                                fattr->cf_dtype = DT_CHR;
                                if (bytes_read == 24) {
                                        fattr->cf_rdev = MKDEV(mjr, mnr);
                                }
                        } else if (memcmp("IntxLNK", pbuf, 7) == 0) {
 -                              cFYI(1, ("Symlink"));
 +                              cFYI(1, "Symlink");
                                fattr->cf_mode |= S_IFLNK;
                                fattr->cf_dtype = DT_LNK;
                        } else {
@@@ -439,10 -439,10 +439,10 @@@ static int cifs_sfu_mode(struct cifs_fa
        else if (rc > 3) {
                mode = le32_to_cpu(*((__le32 *)ea_value));
                fattr->cf_mode &= ~SFBITS_MASK;
 -              cFYI(1, ("special bits 0%o org mode 0%o", mode,
 -                       fattr->cf_mode));
 +              cFYI(1, "special bits 0%o org mode 0%o", mode,
 +                       fattr->cf_mode);
                fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode;
 -              cFYI(1, ("special mode bits 0%o", mode));
 +              cFYI(1, "special mode bits 0%o", mode);
        }
  
        return 0;
@@@ -548,11 -548,11 +548,11 @@@ int cifs_get_inode_info(struct inode **
        struct cifs_fattr fattr;
  
        pTcon = cifs_sb->tcon;
 -      cFYI(1, ("Getting info on %s", full_path));
 +      cFYI(1, "Getting info on %s", full_path);
  
        if ((pfindData == NULL) && (*pinode != NULL)) {
                if (CIFS_I(*pinode)->clientCanCacheRead) {
 -                      cFYI(1, ("No need to revalidate cached inode sizes"));
 +                      cFYI(1, "No need to revalidate cached inode sizes");
                        return rc;
                }
        }
                                        cifs_sb->mnt_cifs_flags &
                                                CIFS_MOUNT_MAP_SPECIAL_CHR);
                        if (rc1 || !fattr.cf_uniqueid) {
 -                              cFYI(1, ("GetSrvInodeNum rc %d", rc1));
 +                              cFYI(1, "GetSrvInodeNum rc %d", rc1);
                                fattr.cf_uniqueid = iunique(sb, ROOT_I);
                                cifs_autodisable_serverino(cifs_sb);
                        }
            cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
                tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid);
                if (tmprc)
 -                      cFYI(1, ("cifs_sfu_type failed: %d", tmprc));
 +                      cFYI(1, "cifs_sfu_type failed: %d", tmprc);
        }
  
  #ifdef CONFIG_CIFS_EXPERIMENTAL
        /* fill in 0777 bits from ACL */
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
 -              cFYI(1, ("Getting mode bits from ACL"));
 +              cFYI(1, "Getting mode bits from ACL");
                cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid);
        }
  #endif
@@@ -715,6 -715,16 +715,16 @@@ cifs_find_inode(struct inode *inode, vo
        if (CIFS_I(inode)->uniqueid != fattr->cf_uniqueid)
                return 0;
  
+       /*
+        * uh oh -- it's a directory. We can't use it since hardlinked dirs are
+        * verboten. Disable serverino and return it as if it were found, the
+        * caller can discard it, generate a uniqueid and retry the find
+        */
+       if (S_ISDIR(inode->i_mode) && !list_empty(&inode->i_dentry)) {
+               fattr->cf_flags |= CIFS_FATTR_INO_COLLISION;
+               cifs_autodisable_serverino(CIFS_SB(inode->i_sb));
+       }
        return 1;
  }
  
@@@ -734,15 -744,22 +744,22 @@@ cifs_iget(struct super_block *sb, struc
        unsigned long hash;
        struct inode *inode;
  
 -      cFYI(1, ("looking for uniqueid=%llu", fattr->cf_uniqueid));
+ retry_iget5_locked:
 +      cFYI(1, "looking for uniqueid=%llu", fattr->cf_uniqueid);
  
        /* hash down to 32-bits on 32-bit arch */
        hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);
  
        inode = iget5_locked(sb, hash, cifs_find_inode, cifs_init_inode, fattr);
-       /* we have fattrs in hand, update the inode */
        if (inode) {
+               /* was there a problematic inode number collision? */
+               if (fattr->cf_flags & CIFS_FATTR_INO_COLLISION) {
+                       iput(inode);
+                       fattr->cf_uniqueid = iunique(sb, ROOT_I);
+                       fattr->cf_flags &= ~CIFS_FATTR_INO_COLLISION;
+                       goto retry_iget5_locked;
+               }
                cifs_fattr_to_inode(inode, fattr);
                if (sb->s_flags & MS_NOATIME)
                        inode->i_flags |= S_NOATIME | S_NOCMTIME;
@@@ -780,7 -797,7 +797,7 @@@ struct inode *cifs_root_iget(struct sup
                return ERR_PTR(-ENOMEM);
  
        if (rc && cifs_sb->tcon->ipc) {
 -              cFYI(1, ("ipc connection - fake read inode"));
 +              cFYI(1, "ipc connection - fake read inode");
                inode->i_mode |= S_IFDIR;
                inode->i_nlink = 2;
                inode->i_op = &cifs_ipc_inode_ops;
@@@ -842,7 -859,7 +859,7 @@@ cifs_set_file_info(struct inode *inode
         * server times.
         */
        if (set_time && (attrs->ia_valid & ATTR_CTIME)) {
 -              cFYI(1, ("CIFS - CTIME changed"));
 +              cFYI(1, "CIFS - CTIME changed");
                info_buf.ChangeTime =
                    cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime));
        } else
                        goto out;
        }
  
 -      cFYI(1, ("calling SetFileInfo since SetPathInfo for "
 -               "times not supported by this server"));
 +      cFYI(1, "calling SetFileInfo since SetPathInfo for "
 +               "times not supported by this server");
        rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN,
                         SYNCHRONIZE | FILE_WRITE_ATTRIBUTES,
                         CREATE_NOT_DIR, &netfid, &oplock,
@@@ -1036,7 -1053,7 +1053,7 @@@ int cifs_unlink(struct inode *dir, stru
        struct iattr *attrs = NULL;
        __u32 dosattr = 0, origattr = 0;
  
 -      cFYI(1, ("cifs_unlink, dir=0x%p, dentry=0x%p", dir, dentry));
 +      cFYI(1, "cifs_unlink, dir=0x%p, dentry=0x%p", dir, dentry);
  
        xid = GetXid();
  
                rc = CIFSPOSIXDelFile(xid, tcon, full_path,
                        SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls,
                        cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
 -              cFYI(1, ("posix del rc %d", rc));
 +              cFYI(1, "posix del rc %d", rc);
                if ((rc == 0) || (rc == -ENOENT))
                        goto psx_del_no_retry;
        }
@@@ -1129,7 -1146,7 +1146,7 @@@ int cifs_mkdir(struct inode *inode, str
        struct inode *newinode = NULL;
        struct cifs_fattr fattr;
  
 -      cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode));
 +      cFYI(1, "In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode);
  
        xid = GetXid();
  
                        kfree(pInfo);
                        goto mkdir_retry_old;
                } else if (rc) {
 -                      cFYI(1, ("posix mkdir returned 0x%x", rc));
 +                      cFYI(1, "posix mkdir returned 0x%x", rc);
                        d_drop(direntry);
                } else {
                        if (pInfo->Type == cpu_to_le32(-1)) {
                        d_instantiate(direntry, newinode);
  
  #ifdef CONFIG_CIFS_DEBUG2
 -                      cFYI(1, ("instantiated dentry %p %s to inode %p",
 -                              direntry, direntry->d_name.name, newinode));
 +                      cFYI(1, "instantiated dentry %p %s to inode %p",
 +                              direntry, direntry->d_name.name, newinode);
  
                        if (newinode->i_nlink != 2)
 -                              cFYI(1, ("unexpected number of links %d",
 -                                      newinode->i_nlink));
 +                              cFYI(1, "unexpected number of links %d",
 +                                      newinode->i_nlink);
  #endif
                }
                kfree(pInfo);
@@@ -1206,7 -1223,7 +1223,7 @@@ mkdir_retry_old
        rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls,
                          cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
        if (rc) {
 -              cFYI(1, ("cifs_mkdir returned 0x%x", rc));
 +              cFYI(1, "cifs_mkdir returned 0x%x", rc);
                d_drop(direntry);
        } else {
  mkdir_get_info:
@@@ -1309,7 -1326,7 +1326,7 @@@ int cifs_rmdir(struct inode *inode, str
        char *full_path = NULL;
        struct cifsInodeInfo *cifsInode;
  
 -      cFYI(1, ("cifs_rmdir, inode = 0x%p", inode));
 +      cFYI(1, "cifs_rmdir, inode = 0x%p", inode);
  
        xid = GetXid();
  
@@@ -1577,9 -1594,9 +1594,9 @@@ int cifs_revalidate_dentry(struct dentr
                goto check_inval;
        }
  
 -      cFYI(1, ("Revalidate: %s inode 0x%p count %d dentry: 0x%p d_time %ld "
 +      cFYI(1, "Revalidate: %s inode 0x%p count %d dentry: 0x%p d_time %ld "
                 "jiffies %ld", full_path, inode, inode->i_count.counter,
 -               dentry, dentry->d_time, jiffies));
 +               dentry, dentry->d_time, jiffies);
  
        if (CIFS_SB(sb)->tcon->unix_ext)
                rc = cifs_get_inode_info_unix(&inode, full_path, sb, xid);
@@@ -1673,12 -1690,12 +1690,12 @@@ cifs_set_file_size(struct inode *inode
                rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, nfid,
                                        npid, false);
                cifsFileInfo_put(open_file);
 -              cFYI(1, ("SetFSize for attrs rc = %d", rc));
 +              cFYI(1, "SetFSize for attrs rc = %d", rc);
                if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
                        unsigned int bytes_written;
                        rc = CIFSSMBWrite(xid, pTcon, nfid, 0, attrs->ia_size,
                                          &bytes_written, NULL, NULL, 1);
 -                      cFYI(1, ("Wrt seteof rc %d", rc));
 +                      cFYI(1, "Wrt seteof rc %d", rc);
                }
        } else
                rc = -EINVAL;
                                   false, cifs_sb->local_nls,
                                   cifs_sb->mnt_cifs_flags &
                                        CIFS_MOUNT_MAP_SPECIAL_CHR);
 -              cFYI(1, ("SetEOF by path (setattrs) rc = %d", rc));
 +              cFYI(1, "SetEOF by path (setattrs) rc = %d", rc);
                if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
                        __u16 netfid;
                        int oplock = 0;
                                                  attrs->ia_size,
                                                  &bytes_written, NULL,
                                                  NULL, 1);
 -                              cFYI(1, ("wrt seteof rc %d", rc));
 +                              cFYI(1, "wrt seteof rc %d", rc);
                                CIFSSMBClose(xid, pTcon, netfid);
                        }
                }
@@@ -1737,8 -1754,8 +1754,8 @@@ cifs_setattr_unix(struct dentry *dirent
        struct cifs_unix_set_info_args *args = NULL;
        struct cifsFileInfo *open_file;
  
 -      cFYI(1, ("setattr_unix on file %s attrs->ia_valid=0x%x",
 -               direntry->d_name.name, attrs->ia_valid));
 +      cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x",
 +               direntry->d_name.name, attrs->ia_valid);
  
        xid = GetXid();
  
@@@ -1868,8 -1885,8 +1885,8 @@@ cifs_setattr_nounix(struct dentry *dire
  
        xid = GetXid();
  
 -      cFYI(1, ("setattr on file %s attrs->iavalid 0x%x",
 -               direntry->d_name.name, attrs->ia_valid));
 +      cFYI(1, "setattr on file %s attrs->iavalid 0x%x",
 +               direntry->d_name.name, attrs->ia_valid);
  
        if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) {
                /* check if we have permission to change attrs */
                attrs->ia_valid &= ~ATTR_MODE;
  
        if (attrs->ia_valid & ATTR_MODE) {
 -              cFYI(1, ("Mode changed to 0%o", attrs->ia_mode));
 +              cFYI(1, "Mode changed to 0%o", attrs->ia_mode);
                mode = attrs->ia_mode;
        }
  
@@@ -2012,7 -2029,7 +2029,7 @@@ cifs_setattr(struct dentry *direntry, s
  #if 0
  void cifs_delete_inode(struct inode *inode)
  {
 -      cFYI(1, ("In cifs_delete_inode, inode = 0x%p", inode));
 +      cFYI(1, "In cifs_delete_inode, inode = 0x%p", inode);
        /* may have to add back in if and when safe distributed caching of
           directories added e.g. via FindNotify */
  }