From a14956f13f934d32043783b0e98e9d659de5d228 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Sat, 22 Dec 2007 14:03:25 -0800 Subject: [PATCH] --- yaml --- r: 75149 b: refs/heads/master c: 22dd483721939b4ea22d5d3925e69112f63c42bc h: refs/heads/master i: 75147: 71a518cc3d06fc1f78bfcc8fc1a7d91727f93484 v: v3 --- [refs] | 2 +- trunk/fs/dquot.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f1b30a65739e..9b51f58b70bb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b88629060b03adc58639f818fe0968bf5fe81b5d +refs/heads/master: 22dd483721939b4ea22d5d3925e69112f63c42bc diff --git a/trunk/fs/dquot.c b/trunk/fs/dquot.c index 686ab63a7c6c..b2592abaa713 100644 --- a/trunk/fs/dquot.c +++ b/trunk/fs/dquot.c @@ -895,9 +895,6 @@ static void print_warning(struct dquot *dquot, const char warntype) #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 +911,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 +958,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); }