Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
authorSteve French <sfrench@us.ibm.com>
Sun, 25 Jun 2006 15:57:32 +0000 (15:57 +0000)
committerSteve French <sfrench@us.ibm.com>
Sun, 25 Jun 2006 15:57:32 +0000 (15:57 +0000)
1  2 
fs/Kconfig
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/cifs/file.c

diff --combined fs/Kconfig
index d49b2a8c0be6153ae6caef1ec4bf267dfb975c40,2aa4624cc0188e51973326e2b6e6354e99ce3bce..467f7ae5f092717745cbc93fe7f41e5fc77181c7
@@@ -53,7 -53,7 +53,7 @@@ config EXT2_FS_SECURIT
  
  config EXT2_FS_XIP
        bool "Ext2 execute in place support"
-       depends on EXT2_FS
+       depends on EXT2_FS && MMU
        help
          Execute in place can be used on memory-backed block devices. If you
          enable this option, you can select to mount block devices which are
@@@ -393,18 -393,30 +393,30 @@@ config INOTIF
        bool "Inotify file change notification support"
        default y
        ---help---
-         Say Y here to enable inotify support and the associated system
-         calls.  Inotify is a file change notification system and a
-         replacement for dnotify.  Inotify fixes numerous shortcomings in
-         dnotify and introduces several new features.  It allows monitoring
-         of both files and directories via a single open fd.  Other features
-         include multiple file events, one-shot support, and unmount
+         Say Y here to enable inotify support.  Inotify is a file change
+         notification system and a replacement for dnotify.  Inotify fixes
+         numerous shortcomings in dnotify and introduces several new features
+         including multiple file events, one-shot support, and unmount
          notification.
  
          For more information, see Documentation/filesystems/inotify.txt
  
          If unsure, say Y.
  
+ config INOTIFY_USER
+       bool "Inotify support for userspace"
+       depends on INOTIFY
+       default y
+       ---help---
+         Say Y here to enable inotify support for userspace, including the
+         associated system calls.  Inotify allows monitoring of both files and
+         directories via a single open fd.  Events are read from the file
+         descriptor, which is also select()- and poll()-able.
+         For more information, see Documentation/filesystems/inotify.txt
+         If unsure, say Y.
  config QUOTA
        bool "Quota support"
        help
@@@ -1101,6 -1113,44 +1113,44 @@@ config JFFS2_SUMMAR
  
          If unsure, say 'N'.
  
+ config JFFS2_FS_XATTR
+       bool "JFFS2 XATTR support (EXPERIMENTAL)"
+       depends on JFFS2_FS && EXPERIMENTAL && !JFFS2_FS_WRITEBUFFER
+       default n
+       help
+         Extended attributes are name:value pairs associated with inodes by
+         the kernel or by users (see the attr(5) manual page, or visit
+         <http://acl.bestbits.at/> for details).
+         
+         If unsure, say N.
+ config JFFS2_FS_POSIX_ACL
+       bool "JFFS2 POSIX Access Control Lists"
+       depends on JFFS2_FS_XATTR
+       default y
+       select FS_POSIX_ACL
+       help
+         Posix Access Control Lists (ACLs) support permissions for users and
+         groups beyond the owner/group/world scheme.
+         
+         To learn more about Access Control Lists, visit the Posix ACLs for
+         Linux website <http://acl.bestbits.at/>.
+         
+         If you don't know what Access Control Lists are, say N
+ config JFFS2_FS_SECURITY
+       bool "JFFS2 Security Labels"
+       depends on JFFS2_FS_XATTR
+       default y
+       help
+         Security labels support alternative access control models
+         implemented by security modules like SELinux.  This option
+         enables an extended attribute handler for file security
+         labels in the jffs2 filesystem.
+         
+         If you are not using a security module that requires using
+         extended attributes for file security labels, say N.
  config JFFS2_COMPRESSION_OPTIONS
        bool "Advanced compression options for JFFS2"
        depends on JFFS2_FS
@@@ -1663,7 -1713,7 +1713,7 @@@ config CIFS_STAT
          mounted by the cifs client to be displayed in /proc/fs/cifs/Stats
  
  config CIFS_STATS2
 -      bool "CIFS extended statistics"
 +      bool "Extended statistics"
        depends on CIFS_STATS
        help
          Enabling this option will allow more detailed statistics on SMB
          Unless you are a developer or are doing network performance analysis
          or tuning, say N.
  
 +config CIFS_WEAK_PW_HASH
 +      bool "Support legacy servers which use weaker LANMAN security"
 +      depends on CIFS
 +      help
 +        Modern CIFS servers including Samba and most Windows versions
 +        (since 1997) support stronger NTLM (and even NTLMv2 and Kerberos)
 +        security mechanisms. These hash the password more securely
 +        than the mechanisms used in the older LANMAN version of the
 +          SMB protocol needed to establish sessions with old SMB servers.
 +
 +        Enabling this option allows the cifs module to mount to older
 +        LANMAN based servers such as OS/2 and Windows 95, but such
 +        mounts may be less secure than mounts using NTLM or more recent
 +        security mechanisms if you are on a public network.  Unless you
 +        have a need to access old SMB servers (and are on a private 
 +        network) you probably want to say N.  Even if this support
 +        is enabled in the kernel build, they will not be used
 +        automatically. At runtime LANMAN mounts are disabled but
 +        can be set to required (or optional) either in
 +        /proc/fs/cifs (see fs/cifs/README for more detail) or via an
 +        option on the mount command. This support is disabled by 
 +        default in order to reduce the possibility of a downgrade
 +        attack.
 + 
 +        If unsure, say N.
 +
  config CIFS_XATTR
          bool "CIFS extended attributes"
          depends on CIFS
@@@ -1730,16 -1754,6 +1780,16 @@@ config CIFS_POSI
          (such as Samba 3.10 and later) which can negotiate
          CIFS POSIX ACL support.  If unsure, say N.
  
 +config CIFS_DEBUG2
 +      bool "Enable additional CIFS debugging routines"
 +      help
 +         Enabling this option adds a few more debugging routines
 +         to the cifs code which slightly increases the size of
 +         the cifs module and can cause additional logging of debug
 +         messages in some error paths, slowing performance. This
 +         option can be turned off unless you are debugging
 +         cifs problems.  If unsure, say N.
 +         
  config CIFS_EXPERIMENTAL
          bool "CIFS Experimental Features (EXPERIMENTAL)"
          depends on CIFS && EXPERIMENTAL
            If unsure, say N.
  
  config CIFS_UPCALL
 -        bool "CIFS Kerberos/SPNEGO advanced session setup (EXPERIMENTAL)"
 +        bool "Kerberos/SPNEGO advanced session setup (EXPERIMENTAL)"
          depends on CIFS_EXPERIMENTAL
          select CONNECTOR
          help
diff --combined fs/cifs/cifsfs.c
index fb7c11c2c9135c34b5e6ee6fed97009e8c88aa9e,7520f4687158d2e1bec34bf96846499fd1a44746..f2e285457bee7df03dbadef3e6a00f22840fd3e5
@@@ -56,8 -56,8 +56,8 @@@ unsigned int experimEnabled = 0
  unsigned int linuxExtEnabled = 1;
  unsigned int lookupCacheEnabled = 1;
  unsigned int multiuser_mount = 0;
 -unsigned int extended_security = 0;
 -unsigned int ntlmv2_support = 0;
 +unsigned int extended_security = CIFSSEC_DEF;
 +/* unsigned int ntlmv2_support = 0; */
  unsigned int sign_CIFS_PDUs = 1;
  extern struct task_struct * oplockThread; /* remove sparse warning */
  struct task_struct * oplockThread = NULL;
@@@ -166,8 -166,9 +166,9 @@@ cifs_put_super(struct super_block *sb
  }
  
  static int
- cifs_statfs(struct super_block *sb, struct kstatfs *buf)
+ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
  {
+       struct super_block *sb = dentry->d_sb;
        int xid; 
        int rc = -EOPNOTSUPP;
        struct cifs_sb_info *cifs_sb;
@@@ -460,9 -461,9 +461,9 @@@ struct super_operations cifs_super_ops 
        .remount_fs = cifs_remount,
  };
  
- static struct super_block *
+ static int
  cifs_get_sb(struct file_system_type *fs_type,
-           int flags, const char *dev_name, void *data)
+           int flags, const char *dev_name, void *data, struct vfsmount *mnt)
  {
        int rc;
        struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL);
        cFYI(1, ("Devname: %s flags: %d ", dev_name, flags));
  
        if (IS_ERR(sb))
-               return sb;
+               return PTR_ERR(sb);
  
        sb->s_flags = flags;
  
        if (rc) {
                up_write(&sb->s_umount);
                deactivate_super(sb);
-               return ERR_PTR(rc);
+               return rc;
        }
        sb->s_flags |= MS_ACTIVE;
-       return sb;
+       return simple_set_mnt(mnt, sb);
  }
  
  static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov,
@@@ -905,7 -906,7 +906,7 @@@ static int cifs_dnotify_thread(void * d
        struct cifsSesInfo *ses;
  
        do {
 -              if(try_to_freeze())
 +              if (try_to_freeze())
                        continue;
                set_current_state(TASK_INTERRUPTIBLE);
                schedule_timeout(15*HZ);
diff --combined fs/cifs/cifsfs.h
index 3011df988bd51507a2e2e85a859155aa46c62f61,d56c0577c7103f95f1c8cd8068f1318cb45ab0cf..a6384d83fdefb00973327aad7df52d6c82032a82
@@@ -33,7 -33,6 +33,7 @@@
  #endif
  
  extern struct address_space_operations cifs_addr_ops;
 +extern struct address_space_operations cifs_addr_ops_smallbuf;
  
  /* Functions related to super block operations */
  extern struct super_operations cifs_super_ops;
@@@ -75,7 -74,7 +75,7 @@@ extern ssize_t cifs_user_write(struct f
                         size_t write_size, loff_t * poffset);
  extern int cifs_lock(struct file *, int, struct file_lock *);
  extern int cifs_fsync(struct file *, struct dentry *, int);
- extern int cifs_flush(struct file *);
+ extern int cifs_flush(struct file *, fl_owner_t id);
  extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
  extern const struct file_operations cifs_dir_ops;
  extern int cifs_dir_open(struct inode *inode, struct file *file);
@@@ -100,5 -99,5 +100,5 @@@ extern ssize_t      cifs_getxattr(struct den
  extern ssize_t        cifs_listxattr(struct dentry *, char *, size_t);
  extern int cifs_ioctl (struct inode * inode, struct file * filep,
                       unsigned int command, unsigned long arg);
 -#define CIFS_VERSION   "1.43"
 +#define CIFS_VERSION   "1.44"
  #endif                                /* _CIFSFS_H */
diff --combined fs/cifs/file.c
index fafdcdffba62c3656df62e76fd6cd4e280234240,b4a18c1cab0a878dca81359c032a8f8b7f2bf83b..616b140534be69b2cd2cd9d542cdc9247ee845e3
@@@ -201,7 -201,7 +201,7 @@@ int cifs_open(struct inode *inode, stru
                } else {
                        if (file->f_flags & O_EXCL)
                                cERROR(1, ("could not find file instance for "
 -                                         "new file %p ", file));
 +                                         "new file %p", file));
                }
        }
  
                rc = -ENOMEM;
                goto out;
        }
 -      rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, desiredAccess,
 -                       CREATE_NOT_DIR, &netfid, &oplock, buf,
 +
 +      if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS)
 +              rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, 
 +                       desiredAccess, CREATE_NOT_DIR, &netfid, &oplock, buf,
                         cifs_sb->local_nls, cifs_sb->mnt_cifs_flags
                                 & CIFS_MOUNT_MAP_SPECIAL_CHR);
 +      else
 +              rc = -EIO; /* no NT SMB support fall into legacy open below */
 +
        if (rc == -EIO) {
                /* Old server, try legacy style OpenX */
                rc = SMBLegacyOpen(xid, pTcon, full_path, disposition,
                                & CIFS_MOUNT_MAP_SPECIAL_CHR);
        }
        if (rc) {
 -              cFYI(1, ("cifs_open returned 0x%x ", rc));
 +              cFYI(1, ("cifs_open returned 0x%x", rc));
                goto out;
        }
        file->private_data =
@@@ -414,8 -409,8 +414,8 @@@ static int cifs_reopen_file(struct inod
                                CIFS_MOUNT_MAP_SPECIAL_CHR);
        if (rc) {
                up(&pCifsFile->fh_sem);
 -              cFYI(1, ("cifs_open returned 0x%x ", rc));
 -              cFYI(1, ("oplock: %d ", oplock));
 +              cFYI(1, ("cifs_open returned 0x%x", rc));
 +              cFYI(1, ("oplock: %d", oplock));
        } else {
                pCifsFile->netfid = netfid;
                pCifsFile->invalidHandle = FALSE;
@@@ -536,7 -531,7 +536,7 @@@ int cifs_closedir(struct inode *inode, 
            (struct cifsFileInfo *)file->private_data;
        char *ptmp;
  
 -      cFYI(1, ("Closedir inode = 0x%p with ", inode));
 +      cFYI(1, ("Closedir inode = 0x%p", inode));
  
        xid = GetXid();
  
@@@ -610,7 -605,7 +610,7 @@@ int cifs_lock(struct file *file, int cm
        }
        if (pfLock->fl_flags & FL_ACCESS)
                cFYI(1, ("Process suspended by mandatory locking - "
 -                       "not implemented yet "));
 +                       "not implemented yet"));
        if (pfLock->fl_flags & FL_LEASE)
                cFYI(1, ("Lease on file - not implemented yet"));
        if (pfLock->fl_flags & 
@@@ -1084,9 -1079,9 +1084,9 @@@ static int cifs_writepages(struct addre
        unsigned int bytes_written;
        struct cifs_sb_info *cifs_sb;
        int done = 0;
-       pgoff_t end = -1;
+       pgoff_t end;
        pgoff_t index;
-       int is_range = 0;
+       int range_whole = 0;
        struct kvec iov[32];
        int len;
        int n_iov = 0;
        xid = GetXid();
  
        pagevec_init(&pvec, 0);
-       if (wbc->sync_mode == WB_SYNC_NONE)
+       if (wbc->range_cyclic) {
                index = mapping->writeback_index; /* Start from prev offset */
-       else {
-               index = 0;
-               scanned = 1;
-       }
-       if (wbc->start || wbc->end) {
-               index = wbc->start >> PAGE_CACHE_SHIFT;
-               end = wbc->end >> PAGE_CACHE_SHIFT;
-               is_range = 1;
+               end = -1;
+       } else {
+               index = wbc->range_start >> PAGE_CACHE_SHIFT;
+               end = wbc->range_end >> PAGE_CACHE_SHIFT;
+               if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
+                       range_whole = 1;
                scanned = 1;
        }
  retry:
                                break;
                        }
  
-                       if (unlikely(is_range) && (page->index > end)) {
+                       if (!wbc->range_cyclic && page->index > end) {
                                done = 1;
                                unlock_page(page);
                                break;
                index = 0;
                goto retry;
        }
-       if (!is_range)
+       if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
                mapping->writeback_index = index;
  
        FreeXid(xid);
@@@ -1382,7 -1375,7 +1380,7 @@@ int cifs_fsync(struct file *file, struc
  
        xid = GetXid();
  
 -      cFYI(1, ("Sync file - name: %s datasync: 0x%x ", 
 +      cFYI(1, ("Sync file - name: %s datasync: 0x%x", 
                dentry->d_name.name, datasync));
        
        rc = filemap_fdatawrite(inode->i_mapping);
  /*    fill in rpages then 
        result = cifs_pagein_inode(inode, index, rpages); */ /* BB finish */
  
 -/*    cFYI(1, ("rpages is %d for sync page of Index %ld ", rpages, index));
 +/*    cFYI(1, ("rpages is %d for sync page of Index %ld", rpages, index));
  
  #if 0
        if (rc < 0)
   * As file closes, flush all cached write data for this inode checking
   * for write behind errors.
   */
- int cifs_flush(struct file *file)
+ int cifs_flush(struct file *file, fl_owner_t id)
  {
        struct inode * inode = file->f_dentry->d_inode;
        int rc = 0;
@@@ -1843,7 -1836,7 +1841,7 @@@ static int cifs_readpage_worker(struct 
        if (rc < 0)
                goto io_error;
        else
 -              cFYI(1, ("Bytes read %d ",rc));
 +              cFYI(1, ("Bytes read %d",rc));
                                                                                                                             
        file->f_dentry->d_inode->i_atime =
                current_fs_time(file->f_dentry->d_inode->i_sb);
@@@ -1964,19 -1957,3 +1962,19 @@@ struct address_space_operations cifs_ad
        /* .sync_page = cifs_sync_page, */
        /* .direct_IO = */
  };
 +
 +/*
 + * cifs_readpages requires the server to support a buffer large enough to
 + * contain the header plus one complete page of data.  Otherwise, we need
 + * to leave cifs_readpages out of the address space operations.
 + */
 +struct address_space_operations cifs_addr_ops_smallbuf = {
 +      .readpage = cifs_readpage,
 +      .writepage = cifs_writepage,
 +      .writepages = cifs_writepages,
 +      .prepare_write = cifs_prepare_write,
 +      .commit_write = cifs_commit_write,
 +      .set_page_dirty = __set_page_dirty_nobuffers,
 +      /* .sync_page = cifs_sync_page, */
 +      /* .direct_IO = */
 +};