]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 23 Dec 2007 21:05:46 +0000 (13:05 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 23 Dec 2007 21:05:46 +0000 (13:05 -0800)
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  MACB: clear transmit buffers properly on transmit underrun
  3c359 endianness annotations and fixes
  fec_mpc52xx: write in C...
  3c574 and 3c589 endianness fixes (.24?)
  rrunner: use offsetof() instead of homegrown insanity
  r8169 endianness
  dl2k endianness fixes (.24 fodder?)
  yellowfin: annotations and fixes (.24 fodder?)
  asix fixes
  cycx: annotations and fixes (.24 fodder?)
  typhoon: trivial endianness annotations
  typhoon: memory corruptor on big-endian if TSO is enabled
  typhoon: missed rx overruns on big-endian
  typhoon: set_settings broken on big-endian
  typhoon: missing le32_to_cpu() in get_drvinfo
  typhoon: endianness bug in tx/rx byte counters
  ipw2200: prevent alloc of unspecified size on stack
  iwlwifi: fix possible priv->mutex deadlock during suspend
  p54: add Kconfig description
  rtl8187: Add USB ID for Sitecom WL-168 v1 001

12 files changed:
MAINTAINERS
arch/um/drivers/harddog_user.c
drivers/char/tty_ioctl.c
drivers/pcmcia/pxa2xx_lubbock.c
drivers/ps3/ps3-vuart.c
fs/dquot.c
fs/ecryptfs/crypto.c
fs/ecryptfs/main.c
fs/ecryptfs/messaging.c
include/linux/quicklist.h
lib/proportions.c
scripts/kconfig/conf.c

index 3c7db6222f86c9c83653533004648988c1e42c1f..907094f07142650066457f50b1561a80ceab0328 100644 (file)
@@ -2029,7 +2029,7 @@ P:        James Ketrenos
 M:     jketreno@linux.intel.com
 L:     linux-wireless@vger.kernel.org
 L:     ipw2100-devel@lists.sourceforge.net
-L:     http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
+W:     http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
 W:     http://ipw2100.sourceforge.net
 S:     Supported
 
@@ -2040,7 +2040,7 @@ P:        James Ketrenos
 M:     jketreno@linux.intel.com
 L:     linux-wireless@vger.kernel.org
 L:     ipw2100-devel@lists.sourceforge.net
-L:     http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
+W:     http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
 W:     http://ipw2200.sourceforge.net
 S:     Supported
 
@@ -2597,7 +2597,7 @@ S:        Maintained
 MSI LAPTOP SUPPORT
 P:     Lennart Poettering
 M:     mzxreary@0pointer.de
-L:     https://tango.0pointer.de/mailman/listinfo/s270-linux
+W:     https://tango.0pointer.de/mailman/listinfo/s270-linux
 W:     http://0pointer.de/lennart/tchibo.html
 S:     Maintained
 
index b56f8e0196a9e1c4bc0d2c6aa3308785e4c750e9..448ba59207a13f0f65e67cef68fd0ccc3f7ebb7e 100644 (file)
@@ -79,14 +79,14 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
        n = read(in_fds[0], &c, sizeof(c));
        if (n == 0) {
                printk("harddog_open - EOF on watchdog pipe\n");
-               helper_wait(pid);
+               helper_wait(pid, 1, NULL);
                err = -EIO;
                goto out_close_out;
        }
        else if (n < 0) {
                printk("harddog_open - read of watchdog pipe failed, "
                       "err = %d\n", errno);
-               helper_wait(pid);
+               helper_wait(pid, 1, NULL);
                err = n;
                goto out_close_out;
        }
index 1bdd2bf4f37d74808bd60bcce01e67a2c6d57f5d..e02d59245a17ecf6b1d78ffd66f5d68c8ead261d 100644 (file)
@@ -62,7 +62,7 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout)
        if (!timeout)
                timeout = MAX_SCHEDULE_TIMEOUT;
        if (wait_event_interruptible_timeout(tty->write_wait,
-                       !tty->driver->chars_in_buffer(tty), timeout))
+                       !tty->driver->chars_in_buffer(tty), timeout) < 0)
                return;
        if (tty->driver->wait_until_sent)
                tty->driver->wait_until_sent(tty, timeout);
index 1510d6cde3e2308e6d26e4ff3fa0824a7429ed21..4a05802213c8bdae09138a359bb92ec025d41d2f 100644 (file)
@@ -213,7 +213,7 @@ static struct pcmcia_low_level lubbock_pcmcia_ops = {
 
 #include "pxa2xx_base.h"
 
-int __init pcmcia_lubbock_init(struct sa1111_dev *sadev)
+int pcmcia_lubbock_init(struct sa1111_dev *sadev)
 {
        int ret = -ENODEV;
 
index 9dea585ef8064f656ebeed605dc834179206ee2c..bb8d5b1eec90256a47d524baac8abb51e039c9ef 100644 (file)
@@ -1074,7 +1074,6 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
        if (result) {
                dev_dbg(&dev->core, "%s:%d: drv->probe failed\n",
                        __func__, __LINE__);
-               down(&vuart_bus_priv.probe_mutex);
                goto fail_probe;
        }
 
index 686ab63a7c6c5c14771d033615aeea15428e23df..cee7c6f428f0fa518e80bda281eb92421a5ac295 100644 (file)
@@ -827,6 +827,18 @@ static inline void dquot_decr_space(struct dquot *dquot, qsize_t number)
        clear_bit(DQ_BLKS_B, &dquot->dq_flags);
 }
 
+static int warning_issued(struct dquot *dquot, const int warntype)
+{
+       int flag = (warntype == QUOTA_NL_BHARDWARN ||
+               warntype == QUOTA_NL_BSOFTLONGWARN) ? DQ_BLKS_B :
+               ((warntype == QUOTA_NL_IHARDWARN ||
+               warntype == QUOTA_NL_ISOFTLONGWARN) ? DQ_INODES_B : 0);
+
+       if (!flag)
+               return 0;
+       return test_and_set_bit(flag, &dquot->dq_flags);
+}
+
 #ifdef CONFIG_PRINT_QUOTA_WARNING
 static int flag_print_warnings = 1;
 
@@ -845,16 +857,12 @@ static inline int need_print_warning(struct dquot *dquot)
 }
 
 /* Print warning to user which exceeded quota */
-static void print_warning(struct dquot *dquot, const char warntype)
+static void print_warning(struct dquot *dquot, const int warntype)
 {
        char *msg = NULL;
        struct tty_struct *tty;
-       int flag = (warntype == QUOTA_NL_BHARDWARN ||
-               warntype == QUOTA_NL_BSOFTLONGWARN) ? DQ_BLKS_B :
-               ((warntype == QUOTA_NL_IHARDWARN ||
-               warntype == QUOTA_NL_ISOFTLONGWARN) ? DQ_INODES_B : 0);
 
-       if (!need_print_warning(dquot) || (flag && test_and_set_bit(flag, &dquot->dq_flags)))
+       if (!need_print_warning(dquot))
                return;
 
        mutex_lock(&tty_mutex);
@@ -895,9 +903,6 @@ out_lock:
 
 #ifdef CONFIG_QUOTA_NETLINK_INTERFACE
 
-/* Size of quota netlink message - actually an upperbound for buffer size */
-#define QUOTA_NL_MSG_SIZE 32
-
 /* Netlink family structure for quota */
 static struct genl_family quota_genl_family = {
        .id = GENL_ID_GENERATE,
@@ -914,11 +919,13 @@ static void send_warning(const struct dquot *dquot, const char warntype)
        struct sk_buff *skb;
        void *msg_head;
        int ret;
+       int msg_size = 4 * nla_total_size(sizeof(u32)) +
+                      2 * nla_total_size(sizeof(u64));
 
        /* We have to allocate using GFP_NOFS as we are called from a
         * filesystem performing write and thus further recursion into
         * the fs to free some data could cause deadlocks. */
-       skb = genlmsg_new(QUOTA_NL_MSG_SIZE, GFP_NOFS);
+       skb = genlmsg_new(msg_size, GFP_NOFS);
        if (!skb) {
                printk(KERN_ERR
                  "VFS: Not enough memory to send quota warning.\n");
@@ -959,7 +966,7 @@ static void send_warning(const struct dquot *dquot, const char warntype)
                        "VFS: Failed to send notification message: %d\n", ret);
        return;
 attr_err_out:
-       printk(KERN_ERR "VFS: Failed to compose quota message: %d\n", ret);
+       printk(KERN_ERR "VFS: Not enough space to compose quota message!\n");
 err_out:
        kfree_skb(skb);
 }
@@ -970,7 +977,8 @@ static inline void flush_warnings(struct dquot * const *dquots, char *warntype)
        int i;
 
        for (i = 0; i < MAXQUOTAS; i++)
-               if (dquots[i] != NODQUOT && warntype[i] != QUOTA_NL_NOWARN) {
+               if (dquots[i] != NODQUOT && warntype[i] != QUOTA_NL_NOWARN &&
+                   !warning_issued(dquots[i], warntype[i])) {
 #ifdef CONFIG_PRINT_QUOTA_WARNING
                        print_warning(dquots[i], warntype[i]);
 #endif
index bbed2fd40fdcd59d125e269afde868880c495724..f8ef0af919e70d27acdb9292acbd0d3d95669bd7 100644 (file)
@@ -799,7 +799,7 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat)
        rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name,
                                                    crypt_stat->cipher, "cbc");
        if (rc)
-               goto out;
+               goto out_unlock;
        crypt_stat->tfm = crypto_alloc_blkcipher(full_alg_name, 0,
                                                 CRYPTO_ALG_ASYNC);
        kfree(full_alg_name);
@@ -808,12 +808,12 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat)
                ecryptfs_printk(KERN_ERR, "cryptfs: init_crypt_ctx(): "
                                "Error initializing cipher [%s]\n",
                                crypt_stat->cipher);
-               mutex_unlock(&crypt_stat->cs_tfm_mutex);
-               goto out;
+               goto out_unlock;
        }
        crypto_blkcipher_set_flags(crypt_stat->tfm, CRYPTO_TFM_REQ_WEAK_KEY);
-       mutex_unlock(&crypt_stat->cs_tfm_mutex);
        rc = 0;
+out_unlock:
+       mutex_unlock(&crypt_stat->cs_tfm_mutex);
 out:
        return rc;
 }
@@ -1847,6 +1847,7 @@ ecryptfs_add_new_key_tfm(struct ecryptfs_key_tfm **key_tfm, char *cipher_name,
        mutex_init(&tmp_tfm->key_tfm_mutex);
        strncpy(tmp_tfm->cipher_name, cipher_name,
                ECRYPTFS_MAX_CIPHER_NAME_SIZE);
+       tmp_tfm->cipher_name[ECRYPTFS_MAX_CIPHER_NAME_SIZE] = '\0';
        tmp_tfm->key_size = key_size;
        rc = ecryptfs_process_key_cipher(&tmp_tfm->key_tfm,
                                         tmp_tfm->cipher_name,
index a277754da17163ee90521aea4c83f6c1fa3ac14f..e5580bcb923a20e7d86e147f9bb9646b42722d15 100644 (file)
@@ -138,11 +138,14 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
                inode_info->lower_file = dentry_open(lower_dentry,
                                                     lower_mnt,
                                                     (O_RDWR | O_LARGEFILE));
-               if (IS_ERR(inode_info->lower_file))
+               if (IS_ERR(inode_info->lower_file)) {
+                       dget(lower_dentry);
+                       mntget(lower_mnt);
                        inode_info->lower_file = dentry_open(lower_dentry,
                                                             lower_mnt,
                                                             (O_RDONLY
                                                              | O_LARGEFILE));
+               }
                if (IS_ERR(inode_info->lower_file)) {
                        printk(KERN_ERR "Error opening lower persistent file "
                               "for lower_dentry [0x%p] and lower_mnt [0x%p]\n",
index a96d341d154d0d0082047ca291632bd4002a7ac9..9cc2aec27b0dc5b8de698dd8779b0cb4e70682b8 100644 (file)
@@ -427,6 +427,7 @@ int ecryptfs_init_messaging(unsigned int transport)
        if (!ecryptfs_daemon_id_hash) {
                rc = -ENOMEM;
                ecryptfs_printk(KERN_ERR, "Failed to allocate memory\n");
+               mutex_unlock(&ecryptfs_daemon_id_hash_mux);
                goto out;
        }
        for (i = 0; i < ecryptfs_hash_buckets; i++)
index 9371c6116df3488d995ecc2bfd3ede17f2b232e6..39b66713a0bba015c9a1d94df6c54d9e781d3991 100644 (file)
@@ -56,14 +56,6 @@ static inline void __quicklist_free(int nr, void (*dtor)(void *), void *p,
        struct page *page)
 {
        struct quicklist *q;
-       int nid = page_to_nid(page);
-
-       if (unlikely(nid != numa_node_id())) {
-               if (dtor)
-                       dtor(p);
-               __free_page(page);
-               return;
-       }
 
        q = &get_cpu_var(quicklist)[nr];
        *(void **)p = q->page;
index 332d8c58184d4964406dfe71179b877fd9f927f6..9508d9a7af3ef9ba482925a9d1cdc34ef2fddd0e 100644 (file)
@@ -190,6 +190,8 @@ prop_adjust_shift(int *pl_shift, unsigned long *pl_period, int new_shift)
  * PERCPU
  */
 
+#define PROP_BATCH (8*(1+ilog2(nr_cpu_ids)))
+
 int prop_local_init_percpu(struct prop_local_percpu *pl)
 {
        spin_lock_init(&pl->lock);
@@ -230,31 +232,24 @@ void prop_norm_percpu(struct prop_global *pg, struct prop_local_percpu *pl)
 
        spin_lock_irqsave(&pl->lock, flags);
        prop_adjust_shift(&pl->shift, &pl->period, pg->shift);
+
        /*
         * For each missed period, we half the local counter.
         * basically:
         *   pl->events >> (global_period - pl->period);
-        *
-        * but since the distributed nature of percpu counters make division
-        * rather hard, use a regular subtraction loop. This is safe, because
-        * the events will only every be incremented, hence the subtraction
-        * can never result in a negative number.
         */
-       while (pl->period != global_period) {
-               unsigned long val = percpu_counter_read(&pl->events);
-               unsigned long half = (val + 1) >> 1;
-
-               /*
-                * Half of zero won't be much less, break out.
-                * This limits the loop to shift iterations, even
-                * if we missed a million.
-                */
-               if (!val)
-                       break;
-
-               percpu_counter_add(&pl->events, -half);
-               pl->period += period;
-       }
+       period = (global_period - pl->period) >> (pg->shift - 1);
+       if (period < BITS_PER_LONG) {
+               s64 val = percpu_counter_read(&pl->events);
+
+               if (val < (nr_cpu_ids * PROP_BATCH))
+                       val = percpu_counter_sum(&pl->events);
+
+               __percpu_counter_add(&pl->events, -val + (val >> period),
+                                       PROP_BATCH);
+       } else
+               percpu_counter_set(&pl->events, 0);
+
        pl->period = global_period;
        spin_unlock_irqrestore(&pl->lock, flags);
 }
@@ -267,7 +262,7 @@ void __prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
        struct prop_global *pg = prop_get_global(pd);
 
        prop_norm_percpu(pg, pl);
-       percpu_counter_add(&pl->events, 1);
+       __percpu_counter_add(&pl->events, 1, PROP_BATCH);
        percpu_counter_add(&pg->events, 1);
        prop_put_global(pd, pg);
 }
index a38787a881ea29bd876efdcbc483867827189b9d..8d6f17490c5efe753e34b28e38158997f6226567 100644 (file)
@@ -374,7 +374,8 @@ static int conf_choice(struct menu *menu)
                                continue;
                        break;
                case set_random:
-                       def = (random() % cnt) + 1;
+                       if (is_new)
+                               def = (random() % cnt) + 1;
                case set_default:
                case set_yes:
                case set_mod: