~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to modules/linux/vmhgfs/inode.c

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
static int HgfsPermission(struct inode *inode,
98
98
                          int mask,
99
99
                          struct nameidata *nameidata);
 
100
#elif defined(IPERM_FLAG_RCU) /* introduced in 2.6.38 */
 
101
static int HgfsPermission(struct inode *inode,
 
102
                          int mask,
 
103
                          unsigned int flags);
100
104
#else
101
105
static int HgfsPermission(struct inode *inode,
102
106
                          int mask);
1781
1785
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)
1782
1786
               , struct nameidata *nd
1783
1787
#endif
 
1788
#ifdef IPERM_FLAG_RCU /* introduced in 2.6.38 */
 
1789
               , unsigned int flags
 
1790
#endif
1784
1791
               )
1785
1792
{
1786
1793
   LOG(8, ("VMware hgfs: %s: inode->mode: %8x mask: %8x\n", __func__,
1794
1801
#else
1795
1802
   if (mask & MAY_ACCESS) { /* For sys_access. */
1796
1803
#endif
1797
 
      struct dentry *dentry = list_entry(inode->i_dentry.next,
1798
 
                                         struct dentry, d_alias);
 
1804
      struct list_head *pos;
 
1805
      int dcount = 0;
 
1806
      struct dentry *dentry = NULL;
 
1807
 
 
1808
#ifdef IPERM_FLAG_RCU
 
1809
      /*
 
1810
       * In 2.6.38 path walk is done in 2 distinct modes: rcu-walk and
 
1811
       * ref-walk. Ref-walk is the classic one; rcu is lockless and is
 
1812
       * not allowed to sleep. We insist on using ref-walk since our
 
1813
       * transports may sleep.
 
1814
       */
 
1815
      if (flags & IPERM_FLAG_RCU)
 
1816
         return -ECHILD;
 
1817
#endif
 
1818
 
 
1819
      /* Find a dentry with valid d_count. Refer bug 587789. */
 
1820
      list_for_each(pos, &inode->i_dentry) {
 
1821
         dentry = list_entry(pos, struct dentry, d_alias);
 
1822
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
 
1823
         dcount = atomic_read(&dentry->d_count);
 
1824
#else
 
1825
         dcount = dentry->d_count;
 
1826
#endif
 
1827
         if (dcount) {
 
1828
            LOG(4, ("Found %s %d \n", (dentry)->d_name.name, dcount));
 
1829
            break;
 
1830
         }
 
1831
      }
 
1832
      ASSERT(dcount);
1799
1833
      return HgfsAccessInt(dentry, mask & (MAY_READ | MAY_WRITE | MAY_EXEC));
1800
1834
   }
1801
1835
   return 0;