2010-01-06 23:47:43

by Greg KH

[permalink] [raw]
Subject: Linux 2.6.31.10

I'm announcing the release of the 2.6.31.10 kernel. All users of the
2.6.31 kernel series are very strongly encouraged to upgrade.

NOTE:
This is probably the next-to-last release of the 2.6.31 kernel series,
barring anything unexpected. All users relying on this kernel version
should now move to the 2.6.32 series as the .31 series will be ending
its lifecycle with the next release.

The updated 2.6.31.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.31.y.git
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.31.y.git;a=summary

thanks,

greg k-h

------------


Makefile | 2
arch/x86/include/asm/processor.h | 2
arch/x86/kernel/ptrace.c | 16 -
drivers/ata/pata_cmd64x.c | 2
drivers/ata/pata_hpt3x2n.c | 64 ++++---
drivers/dma/at_hdmac.c | 4
drivers/hwmon/fschmd.c | 2
drivers/hwmon/sht15.c | 6
drivers/i2c/chips/tsl2550.c | 3
drivers/input/keyboard/atkbd.c | 9 +
drivers/md/md.c | 8
drivers/media/video/ov511.c | 2
drivers/net/e100.c | 19 +-
drivers/net/usb/rtl8150.c | 2
drivers/net/wireless/hostap/hostap_main.c | 3
drivers/net/wireless/libertas/wext.c | 2
drivers/net/wireless/rt2x00/rt61pci.c | 5
drivers/platform/x86/acerhdf.c | 7
drivers/s390/block/dasd_diag.c | 19 +-
drivers/scsi/scsi_transport_fc.c | 17 +
drivers/usb/misc/appledisplay.c | 4
drivers/usb/misc/emi62.c | 2
drivers/usb/musb/musb_gadget_ep0.c | 14 +
drivers/usb/serial/option.c | 5
fs/cifs/connect.c | 13 +
fs/ext4/ext4.h | 6
fs/ext4/inode.c | 27 +--
fs/ext4/super.c | 5
fs/namei.c | 1
fs/quota/dquot.c | 213 +++++++++++++------------
fs/stat.c | 10 -
fs/udf/super.c | 32 ++-
fs/xfs/xfs_log_recover.c | 4
include/linux/fs.h | 1
include/linux/quota.h | 5
include/net/ipv6.h | 7
include/net/netfilter/ipv6/nf_conntrack_ipv6.h | 2
kernel/time/clockevents.c | 18 +-
mm/memcontrol.c | 8
mm/oom_kill.c | 2
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 13 +
net/ipv6/netfilter/nf_conntrack_reasm.c | 7
net/ipv6/reassembly.c | 5
sound/mips/sgio2audio.c | 2
sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 2
sound/soc/codecs/wm9712.c | 3
sound/usb/usbaudio.c | 2
47 files changed, 388 insertions(+), 219 deletions(-)

Bartlomiej Zolnierkiewicz (1):
pata_cmd64x: fix overclocking of UDMA0-2 modes

Clemens Ladisch (2):
sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
USB: emi62: fix crash when trying to load EMI 6|2 firmware

Daisuke Nishimura (1):
memcg: avoid oom-killing innocent task in case of use_hierarchy

Dan Carpenter (1):
V4L/DVB (13596): ov511.c typo: lock => unlock

Daniel Mack (1):
Libertas: fix buffer overflow in lbs_get_essid()

Dmitry Monakhov (4):
Add unlocked version of inode_add_bytes() function
quota: decouple fs reserved space from quota reservation
ext4: Convert to generic reserved quota's space management.
ext4: fix sleep inside spinlock issue with quota and dealloc (#14739)

Donny Kurnia (1):
USB: option: support hi speed for modem Haier CE100

Eric Millbrandt (1):
ASoC: Do not write to invalid registers on the wm9712.

Gertjan van Wingerde (1):
rt2x00: Disable powersaving for rt61pci and rt2800pci.

Greg Kroah-Hartman (1):
Linux 2.6.31.10

Jan Kara (1):
udf: Try harder when looking for VAT inode

Jan Rekorajski (1):
XFS bug in log recover with quota (bugzilla id 855)

Jeff Layton (1):
cifs: NULL out tcon, pSesInfo, and srvTcp pointers when chasing DFS referrals

Jonathan Cameron (1):
hwmon: (sht15) Off-by-one error in array index + incorrect constants

Julia Lawall (1):
drivers/net/usb: Correct code taking the size of a pointer

Linus Torvalds (1):
x86/ptrace: make genregs[32]_get/set more robust

Martin Decky (1):
hostap: Revert a toxic part of the conversion to net_device_ops

Michele Jr De Candia (1):
i2c/tsl2550: Fix lux value in extended mode

Mike Christie (1):
SCSI: fc class: fix fc_transport_init error handling

Moiseev Vladimir (1):
Input: atkbd - add force relese key quirk for Samsung R59P/R60P/R61P

NeilBrown (1):
md: Fix unfortunate interaction with evms

Nicolas Ferre (1):
dma: at_hdmac: correct incompatible type for argument 1 of 'spin_lock_bh'

Patrick McHardy (1):
ipv6: reassembly: use seperate reassembly queues for conntrack and local delivery

Roel Kluin (1):
hwmon: (fschmd) Fix check on unsigned in watchdog_write()

Roger Oksanen (2):
e100: Use pci pool to work around GFP_ATOMIC order 5 memory allocation failure
e100: Fix broken cbs accounting due to missing memset.

Serge E. Hallyn (1):
generic_permission: MAY_OPEN is not write access

Sergei Shtylyov (2):
pata_hpt3x2n: fix clock turnaround
USB: musb: gadget_ep0: avoid SetupEnd interrupt

Stefan Bader (1):
acerhdf: limit modalias matching to supported

Stefan Weinhuber (1):
S390: dasd: support DIAG access for read-only devices

Suresh Siddha (1):
x86, cpuid: Add "volatile" to asm in native_cpuid()

Thomas Gleixner (1):
clockevents: Prevent clockevent_devices list corruption on cpu hotplug

pancho horrillo (1):
USB: Fix a bug on appledisplay.c regarding signedness


2010-01-06 23:48:56

by Greg KH

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

diff --git a/Makefile b/Makefile
index 72b5315..fe266ee 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 31
-EXTRAVERSION = .9
+EXTRAVERSION = .10
NAME = Man-Eating Seals of Antiquity

# *DOCUMENTATION*
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index e597ecc..70c6a93 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -179,7 +179,7 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
/* ecx is often an input as well as an output. */
- asm("cpuid"
+ asm volatile("cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 09ecbde..96e2a86 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -417,14 +417,14 @@ static int genregs_get(struct task_struct *target,
{
if (kbuf) {
unsigned long *k = kbuf;
- while (count > 0) {
+ while (count >= sizeof(*k)) {
*k++ = getreg(target, pos);
count -= sizeof(*k);
pos += sizeof(*k);
}
} else {
unsigned long __user *u = ubuf;
- while (count > 0) {
+ while (count >= sizeof(*u)) {
if (__put_user(getreg(target, pos), u++))
return -EFAULT;
count -= sizeof(*u);
@@ -443,14 +443,14 @@ static int genregs_set(struct task_struct *target,
int ret = 0;
if (kbuf) {
const unsigned long *k = kbuf;
- while (count > 0 && !ret) {
+ while (count >= sizeof(*k) && !ret) {
ret = putreg(target, pos, *k++);
count -= sizeof(*k);
pos += sizeof(*k);
}
} else {
const unsigned long __user *u = ubuf;
- while (count > 0 && !ret) {
+ while (count >= sizeof(*u) && !ret) {
unsigned long word;
ret = __get_user(word, u++);
if (ret)
@@ -1223,14 +1223,14 @@ static int genregs32_get(struct task_struct *target,
{
if (kbuf) {
compat_ulong_t *k = kbuf;
- while (count > 0) {
+ while (count >= sizeof(*k)) {
getreg32(target, pos, k++);
count -= sizeof(*k);
pos += sizeof(*k);
}
} else {
compat_ulong_t __user *u = ubuf;
- while (count > 0) {
+ while (count >= sizeof(*u)) {
compat_ulong_t word;
getreg32(target, pos, &word);
if (__put_user(word, u++))
@@ -1251,14 +1251,14 @@ static int genregs32_set(struct task_struct *target,
int ret = 0;
if (kbuf) {
const compat_ulong_t *k = kbuf;
- while (count > 0 && !ret) {
+ while (count >= sizeof(*k) && !ret) {
ret = putreg32(target, pos, *k++);
count -= sizeof(*k);
pos += sizeof(*k);
}
} else {
const compat_ulong_t __user *u = ubuf;
- while (count > 0 && !ret) {
+ while (count >= sizeof(*u) && !ret) {
compat_ulong_t word;
ret = __get_user(word, u++);
if (ret)
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
index f98dffe..f0bad9b 100644
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -219,7 +219,7 @@ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev)
regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift;
/* Merge the control bits */
regU |= 1 << adev->devno; /* UDMA on */
- if (adev->dma_mode > 2) /* 15nS timing */
+ if (adev->dma_mode > XFER_UDMA_2) /* 15nS timing */
regU |= 4 << adev->devno;
} else {
regU &= ~ (1 << adev->devno); /* UDMA off */
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index 21c5bd6..d16e87e 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -8,7 +8,7 @@
* Copyright (C) 1999-2003 Andre Hedrick <[email protected]>
* Portions Copyright (C) 2001 Sun Microsystems, Inc.
* Portions Copyright (C) 2003 Red Hat Inc
- * Portions Copyright (C) 2005-2007 MontaVista Software, Inc.
+ * Portions Copyright (C) 2005-2009 MontaVista Software, Inc.
*
*
* TODO
@@ -25,7 +25,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_hpt3x2n"
-#define DRV_VERSION "0.3.7"
+#define DRV_VERSION "0.3.8"

enum {
HPT_PCI_FAST = (1 << 31),
@@ -262,7 +262,7 @@ static void hpt3x2n_bmdma_stop(struct ata_queued_cmd *qc)

static void hpt3x2n_set_clock(struct ata_port *ap, int source)
{
- void __iomem *bmdma = ap->ioaddr.bmdma_addr;
+ void __iomem *bmdma = ap->ioaddr.bmdma_addr - ap->port_no * 8;

/* Tristate the bus */
iowrite8(0x80, bmdma+0x73);
@@ -272,9 +272,9 @@ static void hpt3x2n_set_clock(struct ata_port *ap, int source)
iowrite8(source, bmdma+0x7B);
iowrite8(0xC0, bmdma+0x79);

- /* Reset state machines */
- iowrite8(0x37, bmdma+0x70);
- iowrite8(0x37, bmdma+0x74);
+ /* Reset state machines, avoid enabling the disabled channels */
+ iowrite8(ioread8(bmdma+0x70) | 0x32, bmdma+0x70);
+ iowrite8(ioread8(bmdma+0x74) | 0x32, bmdma+0x74);

/* Complete reset */
iowrite8(0x00, bmdma+0x79);
@@ -284,21 +284,10 @@ static void hpt3x2n_set_clock(struct ata_port *ap, int source)
iowrite8(0x00, bmdma+0x77);
}

-/* Check if our partner interface is busy */
-
-static int hpt3x2n_pair_idle(struct ata_port *ap)
-{
- struct ata_host *host = ap->host;
- struct ata_port *pair = host->ports[ap->port_no ^ 1];
-
- if (pair->hsm_task_state == HSM_ST_IDLE)
- return 1;
- return 0;
-}
-
static int hpt3x2n_use_dpll(struct ata_port *ap, int writing)
{
long flags = (long)ap->host->private_data;
+
/* See if we should use the DPLL */
if (writing)
return USE_DPLL; /* Needed for write */
@@ -307,20 +296,35 @@ static int hpt3x2n_use_dpll(struct ata_port *ap, int writing)
return 0;
}

+static int hpt3x2n_qc_defer(struct ata_queued_cmd *qc)
+{
+ struct ata_port *ap = qc->ap;
+ struct ata_port *alt = ap->host->ports[ap->port_no ^ 1];
+ int rc, flags = (long)ap->host->private_data;
+ int dpll = hpt3x2n_use_dpll(ap, qc->tf.flags & ATA_TFLAG_WRITE);
+
+ /* First apply the usual rules */
+ rc = ata_std_qc_defer(qc);
+ if (rc != 0)
+ return rc;
+
+ if ((flags & USE_DPLL) != dpll && alt->qc_active)
+ return ATA_DEFER_PORT;
+ return 0;
+}
+
static unsigned int hpt3x2n_qc_issue(struct ata_queued_cmd *qc)
{
- struct ata_taskfile *tf = &qc->tf;
struct ata_port *ap = qc->ap;
int flags = (long)ap->host->private_data;
+ int dpll = hpt3x2n_use_dpll(ap, qc->tf.flags & ATA_TFLAG_WRITE);

- if (hpt3x2n_pair_idle(ap)) {
- int dpll = hpt3x2n_use_dpll(ap, (tf->flags & ATA_TFLAG_WRITE));
- if ((flags & USE_DPLL) != dpll) {
- if (dpll == 1)
- hpt3x2n_set_clock(ap, 0x21);
- else
- hpt3x2n_set_clock(ap, 0x23);
- }
+ if ((flags & USE_DPLL) != dpll) {
+ flags &= ~USE_DPLL;
+ flags |= dpll;
+ ap->host->private_data = (void *)(long)flags;
+
+ hpt3x2n_set_clock(ap, dpll ? 0x21 : 0x23);
}
return ata_sff_qc_issue(qc);
}
@@ -337,6 +341,8 @@ static struct ata_port_operations hpt3x2n_port_ops = {
.inherits = &ata_bmdma_port_ops,

.bmdma_stop = hpt3x2n_bmdma_stop,
+
+ .qc_defer = hpt3x2n_qc_defer,
.qc_issue = hpt3x2n_qc_issue,

.cable_detect = hpt3x2n_cable_detect,
@@ -454,7 +460,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
unsigned int f_low, f_high;
int adjust;
unsigned long iobase = pci_resource_start(dev, 4);
- void *hpriv = NULL;
+ void *hpriv = (void *)USE_DPLL;
int rc;

rc = pcim_enable_device(dev);
@@ -542,7 +548,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
/* Set our private data up. We only need a few flags so we use
it directly */
if (pci_mhz > 60) {
- hpriv = (void *)PCI66;
+ hpriv = (void *)(PCI66 | USE_DPLL);
/*
* On HPT371N, if ATA clock is 66 MHz we must set bit 2 in
* the MISC. register to stretch the UltraDMA Tss timing.
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 9a1e5fb..73957fb 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -813,7 +813,7 @@ atc_is_tx_complete(struct dma_chan *chan,
dev_vdbg(chan2dev(chan), "is_tx_complete: %d (d%d, u%d)\n",
cookie, done ? *done : 0, used ? *used : 0);

- spin_lock_bh(atchan->lock);
+ spin_lock_bh(&atchan->lock);

last_complete = atchan->completed_cookie;
last_used = chan->cookie;
@@ -828,7 +828,7 @@ atc_is_tx_complete(struct dma_chan *chan,
ret = dma_async_is_complete(cookie, last_complete, last_used);
}

- spin_unlock_bh(atchan->lock);
+ spin_unlock_bh(&atchan->lock);

if (done)
*done = last_complete;
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index ea955ed..37ea6a4 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -819,7 +819,7 @@ static int watchdog_release(struct inode *inode, struct file *filp)
static ssize_t watchdog_write(struct file *filp, const char __user *buf,
size_t count, loff_t *offset)
{
- size_t ret;
+ int ret;
struct fschmd_data *data = filp->private_data;

if (count) {
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index 6290a25..e828d17 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -304,7 +304,7 @@ static inline int sht15_calc_temp(struct sht15_data *data)
int d1 = 0;
int i;

- for (i = 1; i < ARRAY_SIZE(temppoints) - 1; i++)
+ for (i = 1; i < ARRAY_SIZE(temppoints); i++)
/* Find pointer to interpolate */
if (data->supply_uV > temppoints[i - 1].vdd) {
d1 = (data->supply_uV/1000 - temppoints[i - 1].vdd)
@@ -331,12 +331,12 @@ static inline int sht15_calc_humid(struct sht15_data *data)

const int c1 = -4;
const int c2 = 40500; /* x 10 ^ -6 */
- const int c3 = 2800; /* x10 ^ -9 */
+ const int c3 = -2800; /* x10 ^ -9 */

RHlinear = c1*1000
+ c2 * data->val_humid/1000
+ (data->val_humid * data->val_humid * c3)/1000000;
- return (temp - 25000) * (10000 + 800 * data->val_humid)
+ return (temp - 25000) * (10000 + 80 * data->val_humid)
/ 1000000 + RHlinear;
}

diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
index b96f302..ec0a7ca 100644
--- a/drivers/i2c/chips/tsl2550.c
+++ b/drivers/i2c/chips/tsl2550.c
@@ -277,6 +277,7 @@ static DEVICE_ATTR(operating_mode, S_IWUSR | S_IRUGO,

static ssize_t __tsl2550_show_lux(struct i2c_client *client, char *buf)
{
+ struct tsl2550_data *data = i2c_get_clientdata(client);
u8 ch0, ch1;
int ret;

@@ -296,6 +297,8 @@ static ssize_t __tsl2550_show_lux(struct i2c_client *client, char *buf)
ret = tsl2550_calculate_lux(ch0, ch1);
if (ret < 0)
return ret;
+ if (data->operating_mode == 1)
+ ret *= 5;

return sprintf(buf, "%d\n", ret);
}
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 6c6a09b..abc314f 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -1608,6 +1608,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
.driver_data = atkbd_samsung_forced_release_keys,
},
{
+ .ident = "Samsung R59P/R60P/R61P",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "R59P/R60P/R61P"),
+ },
+ .callback = atkbd_setup_forced_release,
+ .driver_data = atkbd_samsung_forced_release_keys,
+ },
+ {
.ident = "Fujitsu Amilo PA 1510",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 5ff27aa..2938e9c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -276,7 +276,9 @@ static void mddev_put(mddev_t *mddev)
if (!atomic_dec_and_lock(&mddev->active, &all_mddevs_lock))
return;
if (!mddev->raid_disks && list_empty(&mddev->disks) &&
- !mddev->hold_active) {
+ mddev->ctime == 0 && !mddev->hold_active) {
+ /* Array is not configured at all, and not held active,
+ * so destroy it */
list_del(&mddev->all_mddevs);
if (mddev->gendisk) {
/* we did a probe so need to clean up.
@@ -5040,6 +5042,10 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info)
mddev->minor_version = info->minor_version;
mddev->patch_version = info->patch_version;
mddev->persistent = !info->not_persistent;
+ /* ensure mddev_put doesn't delete this now that there
+ * is some minimal configuration.
+ */
+ mddev->ctime = get_seconds();
return 0;
}
mddev->major_version = MD_MAJOR_VERSION;
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index 0bc2cf5..2bed9e2 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -5878,7 +5878,7 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id)
goto error;
}

- mutex_lock(&ov->lock);
+ mutex_unlock(&ov->lock);

return 0;

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 3a6735d..c786e6a 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -156,6 +156,7 @@
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
+#include <linux/dmapool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/mii.h>
@@ -601,6 +602,7 @@ struct nic {
struct mem *mem;
dma_addr_t dma_addr;

+ struct pci_pool *cbs_pool;
dma_addr_t cbs_dma_addr;
u8 adaptive_ifs;
u8 tx_threshold;
@@ -1779,9 +1781,7 @@ static void e100_clean_cbs(struct nic *nic)
nic->cb_to_clean = nic->cb_to_clean->next;
nic->cbs_avail++;
}
- pci_free_consistent(nic->pdev,
- sizeof(struct cb) * nic->params.cbs.count,
- nic->cbs, nic->cbs_dma_addr);
+ pci_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr);
nic->cbs = NULL;
nic->cbs_avail = 0;
}
@@ -1799,10 +1799,11 @@ static int e100_alloc_cbs(struct nic *nic)
nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
nic->cbs_avail = 0;

- nic->cbs = pci_alloc_consistent(nic->pdev,
- sizeof(struct cb) * count, &nic->cbs_dma_addr);
+ nic->cbs = pci_pool_alloc(nic->cbs_pool, GFP_KERNEL,
+ &nic->cbs_dma_addr);
if (!nic->cbs)
return -ENOMEM;
+ memset(nic->cbs, 0, count * sizeof(struct cb));

for (cb = nic->cbs, i = 0; i < count; cb++, i++) {
cb->next = (i + 1 < count) ? cb + 1 : nic->cbs;
@@ -1811,7 +1812,6 @@ static int e100_alloc_cbs(struct nic *nic)
cb->dma_addr = nic->cbs_dma_addr + i * sizeof(struct cb);
cb->link = cpu_to_le32(nic->cbs_dma_addr +
((i+1) % count) * sizeof(struct cb));
- cb->skb = NULL;
}

nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = nic->cbs;
@@ -2827,7 +2827,11 @@ static int __devinit e100_probe(struct pci_dev *pdev,
DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n");
goto err_out_free;
}
-
+ nic->cbs_pool = pci_pool_create(netdev->name,
+ nic->pdev,
+ nic->params.cbs.count * sizeof(struct cb),
+ sizeof(u32),
+ 0);
DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n",
(unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
pdev->irq, netdev->dev_addr);
@@ -2857,6 +2861,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
e100_free(nic);
pci_iounmap(pdev, nic->csr);
+ pci_pool_destroy(nic->cbs_pool);
free_netdev(netdev);
pci_release_regions(pdev);
pci_disable_device(pdev);
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index fcc6fa0..1868683 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -324,7 +324,7 @@ static int rtl8150_set_mac_address(struct net_device *netdev, void *p)
dbg("%02X:", netdev->dev_addr[i]);
dbg("%02X\n", netdev->dev_addr[i]);
/* Set the IDR registers. */
- set_registers(dev, IDR, sizeof(netdev->dev_addr), netdev->dev_addr);
+ set_registers(dev, IDR, netdev->addr_len, netdev->dev_addr);
#ifdef EEPROM_WRITE
{
u8 cr;
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 6fe122f..eb57d1e 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -875,15 +875,16 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,

switch(type) {
case HOSTAP_INTERFACE_AP:
+ dev->tx_queue_len = 0; /* use main radio device queue */
dev->netdev_ops = &hostap_mgmt_netdev_ops;
dev->type = ARPHRD_IEEE80211;
dev->header_ops = &hostap_80211_ops;
break;
case HOSTAP_INTERFACE_MASTER:
- dev->tx_queue_len = 0; /* use main radio device queue */
dev->netdev_ops = &hostap_master_ops;
break;
default:
+ dev->tx_queue_len = 0; /* use main radio device queue */
dev->netdev_ops = &hostap_netdev_ops;
}

diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 8bc1907..f9c366c 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -1951,10 +1951,8 @@ static int lbs_get_essid(struct net_device *dev, struct iw_request_info *info,
if (priv->connect_status == LBS_CONNECTED) {
memcpy(extra, priv->curbssparams.ssid,
priv->curbssparams.ssid_len);
- extra[priv->curbssparams.ssid_len] = '\0';
} else {
memset(extra, 0, 32);
- extra[priv->curbssparams.ssid_len] = '\0';
}
/*
* If none, we may want to get the one that was set
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 49b29ff..0d99314 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2546,6 +2546,11 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
unsigned int i;

/*
+ * Disable powersaving as default.
+ */
+ rt2x00dev->hw->wiphy->ps_default = false;
+
+ /*
* Initialize all hw fields.
*/
rt2x00dev->hw->flags =
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index ec13977..034ca6d 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -633,9 +633,10 @@ static void __exit acerhdf_exit(void)
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Peter Feuerer");
MODULE_DESCRIPTION("Aspire One temperature and fan driver");
-MODULE_ALIAS("dmi:*:*Acer*:*:");
-MODULE_ALIAS("dmi:*:*Gateway*:*:");
-MODULE_ALIAS("dmi:*:*Packard Bell*:*:");
+MODULE_ALIAS("dmi:*:*Acer*:pnAOA*:");
+MODULE_ALIAS("dmi:*:*Gateway*:pnAOA*:");
+MODULE_ALIAS("dmi:*:*Packard Bell*:pnAOA*:");
+MODULE_ALIAS("dmi:*:*Packard Bell*:pnDOA*:");

module_init(acerhdf_init);
module_exit(acerhdf_exit);
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 644086b..b76dee9 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -145,6 +145,15 @@ dasd_diag_erp(struct dasd_device *device)

mdsk_term_io(device);
rc = mdsk_init_io(device, device->block->bp_block, 0, NULL);
+ if (rc == 4) {
+ if (!(device->features & DASD_FEATURE_READONLY)) {
+ dev_warn(&device->cdev->dev,
+ "The access mode of a DIAG device changed"
+ " to read-only");
+ device->features |= DASD_FEATURE_READONLY;
+ }
+ rc = 0;
+ }
if (rc)
dev_warn(&device->cdev->dev, "DIAG ERP failed with "
"rc=%d\n", rc);
@@ -433,16 +442,20 @@ dasd_diag_check_device(struct dasd_device *device)
for (sb = 512; sb < bsize; sb = sb << 1)
block->s2b_shift++;
rc = mdsk_init_io(device, block->bp_block, 0, NULL);
- if (rc) {
+ if (rc && (rc != 4)) {
dev_warn(&device->cdev->dev, "DIAG initialization "
"failed with rc=%d\n", rc);
rc = -EIO;
} else {
+ if (rc == 4)
+ device->features |= DASD_FEATURE_READONLY;
dev_info(&device->cdev->dev,
- "New DASD with %ld byte/block, total size %ld KB\n",
+ "New DASD with %ld byte/block, total size %ld KB%s\n",
(unsigned long) block->bp_block,
(unsigned long) (block->blocks <<
- block->s2b_shift) >> 1);
+ block->s2b_shift) >> 1,
+ (rc == 4) ? ", read-only device" : "");
+ rc = 0;
}
out_label:
free_page((long) label);
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 292c02f..7c3264e 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -648,11 +648,22 @@ static __init int fc_transport_init(void)
return error;
error = transport_class_register(&fc_vport_class);
if (error)
- return error;
+ goto unreg_host_class;
error = transport_class_register(&fc_rport_class);
if (error)
- return error;
- return transport_class_register(&fc_transport_class);
+ goto unreg_vport_class;
+ error = transport_class_register(&fc_transport_class);
+ if (error)
+ goto unreg_rport_class;
+ return 0;
+
+unreg_rport_class:
+ transport_class_unregister(&fc_rport_class);
+unreg_vport_class:
+ transport_class_unregister(&fc_vport_class);
+unreg_host_class:
+ transport_class_unregister(&fc_host_class);
+ return error;
}

static void __exit fc_transport_exit(void)
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index 1d8e39a..62ff5e7 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -72,8 +72,8 @@ struct appledisplay {
struct usb_device *udev; /* usb device */
struct urb *urb; /* usb request block */
struct backlight_device *bd; /* backlight device */
- char *urbdata; /* interrupt URB data buffer */
- char *msgdata; /* control message data buffer */
+ u8 *urbdata; /* interrupt URB data buffer */
+ u8 *msgdata; /* control message data buffer */

struct delayed_work work;
int button_pressed;
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
index 602ee05..59860b3 100644
--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -167,7 +167,7 @@ static int emi62_load_firmware (struct usb_device *dev)
err("%s - error loading firmware: error = %d", __func__, err);
goto wraperr;
}
- } while (i > 0);
+ } while (rec);

/* Assert reset (stop the CPU in the EMI) */
err = emi62_set_reset(dev,1);
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index a243276..677cc2e 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -646,7 +646,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb)
musb->ep0_state = MUSB_EP0_STAGE_STATUSIN;
break;
default:
- ERR("SetupEnd came in a wrong ep0stage %s",
+ ERR("SetupEnd came in a wrong ep0stage %s\n",
decode_ep0stage(musb->ep0_state));
}
csr = musb_readw(regs, MUSB_CSR0);
@@ -769,12 +769,18 @@ setup:
handled = service_zero_data_request(
musb, &setup);

+ /*
+ * We're expecting no data in any case, so
+ * always set the DATAEND bit -- doing this
+ * here helps avoid SetupEnd interrupt coming
+ * in the idle stage when we're stalling...
+ */
+ musb->ackpend |= MUSB_CSR0_P_DATAEND;
+
/* status stage might be immediate */
- if (handled > 0) {
- musb->ackpend |= MUSB_CSR0_P_DATAEND;
+ if (handled > 0)
musb->ep0_state =
MUSB_EP0_STAGE_STATUSIN;
- }
break;

/* sequence #1 (IN to host), includes GET_STATUS
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index e2a2e85..c7b42ca 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -337,6 +337,10 @@ static int option_resume(struct usb_serial *serial);
#define AIRPLUS_VENDOR_ID 0x1011
#define AIRPLUS_PRODUCT_MCD650 0x3198

+/* Haier products */
+#define HAIER_VENDOR_ID 0x201e
+#define HAIER_PRODUCT_CE100 0x2009
+
static struct usb_device_id option_ids[] = {
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -637,6 +641,7 @@ static struct usb_device_id option_ids[] = {
{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) },
{ USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
{ USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
+ { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 5c084e5..08a44ca 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2267,12 +2267,12 @@ int
cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
char *mount_data_global, const char *devname)
{
- int rc = 0;
+ int rc;
int xid;
struct smb_vol *volume_info;
- struct cifsSesInfo *pSesInfo = NULL;
- struct cifsTconInfo *tcon = NULL;
- struct TCP_Server_Info *srvTcp = NULL;
+ struct cifsSesInfo *pSesInfo;
+ struct cifsTconInfo *tcon;
+ struct TCP_Server_Info *srvTcp;
char *full_path;
char *mount_data = mount_data_global;
#ifdef CONFIG_CIFS_DFS_UPCALL
@@ -2281,6 +2281,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
int referral_walks_count = 0;
try_mount_again:
#endif
+ rc = 0;
+ tcon = NULL;
+ pSesInfo = NULL;
+ srvTcp = NULL;
full_path = NULL;

xid = GetXid();
@@ -2577,6 +2581,7 @@ remote_path_check:

cleanup_volume_info(&volume_info);
referral_walks_count++;
+ FreeXid(xid);
goto try_mount_again;
}
#else /* No DFS support, return error on mount */
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 3b8321b..9bd595a 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -695,6 +695,10 @@ struct ext4_inode_info {
__u16 i_extra_isize;

spinlock_t i_block_reservation_lock;
+#ifdef CONFIG_QUOTA
+ /* quota space reservation, managed internally by quota code */
+ qsize_t i_reserved_quota;
+#endif

/* completed async DIOs that might need unwritten extents handling */
struct list_head i_aio_dio_complete_list;
@@ -1439,7 +1443,7 @@ extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);
extern int ext4_block_truncate_page(handle_t *handle,
struct address_space *mapping, loff_t from);
extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
-extern qsize_t ext4_get_reserved_space(struct inode *inode);
+extern qsize_t *ext4_get_reserved_space(struct inode *inode);
extern int flush_aio_dio_completed_IO(struct inode *inode);
/* ioctl.c */
extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 38b2154..ef06da6 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1046,17 +1046,12 @@ out:
return err;
}

-qsize_t ext4_get_reserved_space(struct inode *inode)
+#ifdef CONFIG_QUOTA
+qsize_t *ext4_get_reserved_space(struct inode *inode)
{
- unsigned long long total;
-
- spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
- total = EXT4_I(inode)->i_reserved_data_blocks +
- EXT4_I(inode)->i_reserved_meta_blocks;
- spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
-
- return (total << inode->i_blkbits);
+ return &EXT4_I(inode)->i_reserved_quota;
}
+#endif
/*
* Calculate the number of metadata blocks need to reserve
* to allocate @blocks for non extent file based file
@@ -1859,19 +1854,17 @@ repeat:

md_needed = mdblocks - EXT4_I(inode)->i_reserved_meta_blocks;
total = md_needed + nrblocks;
+ spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);

/*
* Make quota reservation here to prevent quota overflow
* later. Real quota accounting is done at pages writeout
* time.
*/
- if (vfs_dq_reserve_block(inode, total)) {
- spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
+ if (vfs_dq_reserve_block(inode, total))
return -EDQUOT;
- }

if (ext4_claim_free_blocks(sbi, total)) {
- spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
vfs_dq_release_reservation_block(inode, total);
if (ext4_should_retry_alloc(inode->i_sb, &retries)) {
yield();
@@ -1879,10 +1872,11 @@ repeat:
}
return -ENOSPC;
}
+ spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
EXT4_I(inode)->i_reserved_data_blocks += nrblocks;
- EXT4_I(inode)->i_reserved_meta_blocks = mdblocks;
-
+ EXT4_I(inode)->i_reserved_meta_blocks += md_needed;
spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
+
return 0; /* success */
}

@@ -4840,6 +4834,9 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32;
inode->i_size = ext4_isize(raw_inode);
ei->i_disksize = inode->i_size;
+#ifdef CONFIG_QUOTA
+ ei->i_reserved_quota = 0;
+#endif
inode->i_generation = le32_to_cpu(raw_inode->i_generation);
ei->i_block_group = iloc.block_group;
ei->i_last_alloc_group = ~0;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ed38f25..3278acf 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -711,6 +711,9 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
ei->i_allocated_meta_blocks = 0;
ei->i_delalloc_reserved_flag = 0;
spin_lock_init(&(ei->i_block_reservation_lock));
+#ifdef CONFIG_QUOTA
+ ei->i_reserved_quota = 0;
+#endif
INIT_LIST_HEAD(&ei->i_aio_dio_complete_list);
ei->cur_aio_dio = NULL;
ei->i_sync_tid = 0;
@@ -1008,7 +1011,9 @@ static struct dquot_operations ext4_quota_operations = {
.reserve_space = dquot_reserve_space,
.claim_space = dquot_claim_space,
.release_rsv = dquot_release_reserved_space,
+#ifdef CONFIG_QUOTA
.get_reserved_space = ext4_get_reserved_space,
+#endif
.alloc_inode = dquot_alloc_inode,
.free_space = dquot_free_space,
.free_inode = dquot_free_inode,
diff --git a/fs/namei.c b/fs/namei.c
index fcfc553..b224905 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -221,6 +221,7 @@ int generic_permission(struct inode *inode, int mask,
/*
* Searching includes executable on directories, else just read.
*/
+ mask &= MAY_READ | MAY_WRITE | MAY_EXEC;
if (mask == MAY_READ || (S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE)))
if (capable(CAP_DAC_READ_SEARCH))
return 0;
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 38f7bd5..5c5f08b 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1388,6 +1388,67 @@ void vfs_dq_drop(struct inode *inode)
EXPORT_SYMBOL(vfs_dq_drop);

/*
+ * inode_reserved_space is managed internally by quota, and protected by
+ * i_lock similar to i_blocks+i_bytes.
+ */
+static qsize_t *inode_reserved_space(struct inode * inode)
+{
+ /* Filesystem must explicitly define it's own method in order to use
+ * quota reservation interface */
+ BUG_ON(!inode->i_sb->dq_op->get_reserved_space);
+ return inode->i_sb->dq_op->get_reserved_space(inode);
+}
+
+static void inode_add_rsv_space(struct inode *inode, qsize_t number)
+{
+ spin_lock(&inode->i_lock);
+ *inode_reserved_space(inode) += number;
+ spin_unlock(&inode->i_lock);
+}
+
+
+static void inode_claim_rsv_space(struct inode *inode, qsize_t number)
+{
+ spin_lock(&inode->i_lock);
+ *inode_reserved_space(inode) -= number;
+ __inode_add_bytes(inode, number);
+ spin_unlock(&inode->i_lock);
+}
+
+static void inode_sub_rsv_space(struct inode *inode, qsize_t number)
+{
+ spin_lock(&inode->i_lock);
+ *inode_reserved_space(inode) -= number;
+ spin_unlock(&inode->i_lock);
+}
+
+static qsize_t inode_get_rsv_space(struct inode *inode)
+{
+ qsize_t ret;
+ spin_lock(&inode->i_lock);
+ ret = *inode_reserved_space(inode);
+ spin_unlock(&inode->i_lock);
+ return ret;
+}
+
+static void inode_incr_space(struct inode *inode, qsize_t number,
+ int reserve)
+{
+ if (reserve)
+ inode_add_rsv_space(inode, number);
+ else
+ inode_add_bytes(inode, number);
+}
+
+static void inode_decr_space(struct inode *inode, qsize_t number, int reserve)
+{
+ if (reserve)
+ inode_sub_rsv_space(inode, number);
+ else
+ inode_sub_bytes(inode, number);
+}
+
+/*
* Following four functions update i_blocks+i_bytes fields and
* quota information (together with appropriate checks)
* NOTE: We absolutely rely on the fact that caller dirties
@@ -1405,6 +1466,21 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number,
int cnt, ret = QUOTA_OK;
char warntype[MAXQUOTAS];

+ /*
+ * First test before acquiring mutex - solves deadlocks when we
+ * re-enter the quota code and are already holding the mutex
+ */
+ if (IS_NOQUOTA(inode)) {
+ inode_incr_space(inode, number, reserve);
+ goto out;
+ }
+
+ down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
+ if (IS_NOQUOTA(inode)) {
+ inode_incr_space(inode, number, reserve);
+ goto out_unlock;
+ }
+
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
warntype[cnt] = QUOTA_NL_NOWARN;

@@ -1415,7 +1491,8 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number,
if (check_bdq(inode->i_dquot[cnt], number, warn, warntype+cnt)
== NO_QUOTA) {
ret = NO_QUOTA;
- goto out_unlock;
+ spin_unlock(&dq_data_lock);
+ goto out_flush_warn;
}
}
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
@@ -1426,64 +1503,32 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number,
else
dquot_incr_space(inode->i_dquot[cnt], number);
}
- if (!reserve)
- inode_add_bytes(inode, number);
-out_unlock:
+ inode_incr_space(inode, number, reserve);
spin_unlock(&dq_data_lock);
- flush_warnings(inode->i_dquot, warntype);
- return ret;
-}
-
-int dquot_alloc_space(struct inode *inode, qsize_t number, int warn)
-{
- int cnt, ret = QUOTA_OK;
-
- /*
- * First test before acquiring mutex - solves deadlocks when we
- * re-enter the quota code and are already holding the mutex
- */
- if (IS_NOQUOTA(inode)) {
- inode_add_bytes(inode, number);
- goto out;
- }
-
- down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
- if (IS_NOQUOTA(inode)) {
- inode_add_bytes(inode, number);
- goto out_unlock;
- }
-
- ret = __dquot_alloc_space(inode, number, warn, 0);
- if (ret == NO_QUOTA)
- goto out_unlock;

+ if (reserve)
+ goto out_flush_warn;
/* Dirtify all the dquots - this can block when journalling */
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
if (inode->i_dquot[cnt])
mark_dquot_dirty(inode->i_dquot[cnt]);
+out_flush_warn:
+ flush_warnings(inode->i_dquot, warntype);
out_unlock:
up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
out:
return ret;
}
+
+int dquot_alloc_space(struct inode *inode, qsize_t number, int warn)
+{
+ return __dquot_alloc_space(inode, number, warn, 0);
+}
EXPORT_SYMBOL(dquot_alloc_space);

int dquot_reserve_space(struct inode *inode, qsize_t number, int warn)
{
- int ret = QUOTA_OK;
-
- if (IS_NOQUOTA(inode))
- goto out;
-
- down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
- if (IS_NOQUOTA(inode))
- goto out_unlock;
-
- ret = __dquot_alloc_space(inode, number, warn, 1);
-out_unlock:
- up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
-out:
- return ret;
+ return __dquot_alloc_space(inode, number, warn, 1);
}
EXPORT_SYMBOL(dquot_reserve_space);

@@ -1540,14 +1585,14 @@ int dquot_claim_space(struct inode *inode, qsize_t number)
int ret = QUOTA_OK;

if (IS_NOQUOTA(inode)) {
- inode_add_bytes(inode, number);
+ inode_claim_rsv_space(inode, number);
goto out;
}

down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
if (IS_NOQUOTA(inode)) {
up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
- inode_add_bytes(inode, number);
+ inode_claim_rsv_space(inode, number);
goto out;
}

@@ -1559,7 +1604,7 @@ int dquot_claim_space(struct inode *inode, qsize_t number)
number);
}
/* Update inode bytes */
- inode_add_bytes(inode, number);
+ inode_claim_rsv_space(inode, number);
spin_unlock(&dq_data_lock);
/* Dirtify all the dquots - this can block when journalling */
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
@@ -1572,38 +1617,9 @@ out:
EXPORT_SYMBOL(dquot_claim_space);

/*
- * Release reserved quota space
- */
-void dquot_release_reserved_space(struct inode *inode, qsize_t number)
-{
- int cnt;
-
- if (IS_NOQUOTA(inode))
- goto out;
-
- down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
- if (IS_NOQUOTA(inode))
- goto out_unlock;
-
- spin_lock(&dq_data_lock);
- /* Release reserved dquots */
- for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
- if (inode->i_dquot[cnt])
- dquot_free_reserved_space(inode->i_dquot[cnt], number);
- }
- spin_unlock(&dq_data_lock);
-
-out_unlock:
- up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
-out:
- return;
-}
-EXPORT_SYMBOL(dquot_release_reserved_space);
-
-/*
* This operation can block, but only after everything is updated
*/
-int dquot_free_space(struct inode *inode, qsize_t number)
+int __dquot_free_space(struct inode *inode, qsize_t number, int reserve)
{
unsigned int cnt;
char warntype[MAXQUOTAS];
@@ -1612,7 +1628,7 @@ int dquot_free_space(struct inode *inode, qsize_t number)
* re-enter the quota code and are already holding the mutex */
if (IS_NOQUOTA(inode)) {
out_sub:
- inode_sub_bytes(inode, number);
+ inode_decr_space(inode, number, reserve);
return QUOTA_OK;
}

@@ -1627,21 +1643,43 @@ out_sub:
if (!inode->i_dquot[cnt])
continue;
warntype[cnt] = info_bdq_free(inode->i_dquot[cnt], number);
- dquot_decr_space(inode->i_dquot[cnt], number);
+ if (reserve)
+ dquot_free_reserved_space(inode->i_dquot[cnt], number);
+ else
+ dquot_decr_space(inode->i_dquot[cnt], number);
}
- inode_sub_bytes(inode, number);
+ inode_decr_space(inode, number, reserve);
spin_unlock(&dq_data_lock);
+
+ if (reserve)
+ goto out_unlock;
/* Dirtify all the dquots - this can block when journalling */
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
if (inode->i_dquot[cnt])
mark_dquot_dirty(inode->i_dquot[cnt]);
+out_unlock:
flush_warnings(inode->i_dquot, warntype);
up_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
return QUOTA_OK;
}
+
+int dquot_free_space(struct inode *inode, qsize_t number)
+{
+ return __dquot_free_space(inode, number, 0);
+}
EXPORT_SYMBOL(dquot_free_space);

/*
+ * Release reserved quota space
+ */
+void dquot_release_reserved_space(struct inode *inode, qsize_t number)
+{
+ __dquot_free_space(inode, number, 1);
+
+}
+EXPORT_SYMBOL(dquot_release_reserved_space);
+
+/*
* This operation can block, but only after everything is updated
*/
int dquot_free_inode(const struct inode *inode, qsize_t number)
@@ -1679,19 +1717,6 @@ int dquot_free_inode(const struct inode *inode, qsize_t number)
EXPORT_SYMBOL(dquot_free_inode);

/*
- * call back function, get reserved quota space from underlying fs
- */
-qsize_t dquot_get_reserved_space(struct inode *inode)
-{
- qsize_t reserved_space = 0;
-
- if (sb_any_quota_active(inode->i_sb) &&
- inode->i_sb->dq_op->get_reserved_space)
- reserved_space = inode->i_sb->dq_op->get_reserved_space(inode);
- return reserved_space;
-}
-
-/*
* Transfer the number of inode and blocks from one diskquota to an other.
*
* This operation can block, but only after everything is updated
@@ -1734,7 +1759,7 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr)
}
spin_lock(&dq_data_lock);
cur_space = inode_get_bytes(inode);
- rsv_space = dquot_get_reserved_space(inode);
+ rsv_space = inode_get_rsv_space(inode);
space = cur_space + rsv_space;
/* Build the transfer_from list and check the limits */
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
diff --git a/fs/stat.c b/fs/stat.c
index 075694e..c4ecd52 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -401,9 +401,9 @@ SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename,
}
#endif /* __ARCH_WANT_STAT64 */

-void inode_add_bytes(struct inode *inode, loff_t bytes)
+/* Caller is here responsible for sufficient locking (ie. inode->i_lock) */
+void __inode_add_bytes(struct inode *inode, loff_t bytes)
{
- spin_lock(&inode->i_lock);
inode->i_blocks += bytes >> 9;
bytes &= 511;
inode->i_bytes += bytes;
@@ -411,6 +411,12 @@ void inode_add_bytes(struct inode *inode, loff_t bytes)
inode->i_blocks++;
inode->i_bytes -= 512;
}
+}
+
+void inode_add_bytes(struct inode *inode, loff_t bytes)
+{
+ spin_lock(&inode->i_lock);
+ __inode_add_bytes(inode, bytes);
spin_unlock(&inode->i_lock);
}

diff --git a/fs/udf/super.c b/fs/udf/super.c
index 9d1b8c2..1e4543c 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1078,21 +1078,39 @@ static int udf_fill_partdesc_info(struct super_block *sb,
return 0;
}

-static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
+static void udf_find_vat_block(struct super_block *sb, int p_index,
+ int type1_index, sector_t start_block)
{
struct udf_sb_info *sbi = UDF_SB(sb);
struct udf_part_map *map = &sbi->s_partmaps[p_index];
+ sector_t vat_block;
struct kernel_lb_addr ino;
+
+ /*
+ * VAT file entry is in the last recorded block. Some broken disks have
+ * it a few blocks before so try a bit harder...
+ */
+ ino.partitionReferenceNum = type1_index;
+ for (vat_block = start_block;
+ vat_block >= map->s_partition_root &&
+ vat_block >= start_block - 3 &&
+ !sbi->s_vat_inode; vat_block--) {
+ ino.logicalBlockNum = vat_block - map->s_partition_root;
+ sbi->s_vat_inode = udf_iget(sb, &ino);
+ }
+}
+
+static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
+{
+ struct udf_sb_info *sbi = UDF_SB(sb);
+ struct udf_part_map *map = &sbi->s_partmaps[p_index];
struct buffer_head *bh = NULL;
struct udf_inode_info *vati;
uint32_t pos;
struct virtualAllocationTable20 *vat20;
sector_t blocks = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;

- /* VAT file entry is in the last recorded block */
- ino.partitionReferenceNum = type1_index;
- ino.logicalBlockNum = sbi->s_last_block - map->s_partition_root;
- sbi->s_vat_inode = udf_iget(sb, &ino);
+ udf_find_vat_block(sb, p_index, type1_index, sbi->s_last_block);
if (!sbi->s_vat_inode &&
sbi->s_last_block != blocks - 1) {
printk(KERN_NOTICE "UDF-fs: Failed to read VAT inode from the"
@@ -1100,9 +1118,7 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
"block of the device (%lu).\n",
(unsigned long)sbi->s_last_block,
(unsigned long)blocks - 1);
- ino.partitionReferenceNum = type1_index;
- ino.logicalBlockNum = blocks - 1 - map->s_partition_root;
- sbi->s_vat_inode = udf_iget(sb, &ino);
+ udf_find_vat_block(sb, p_index, type1_index, blocks - 1);
}
if (!sbi->s_vat_inode)
return 1;
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 47da2fb..83ebd52 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1980,7 +1980,7 @@ xlog_recover_do_reg_buffer(
"XFS: NULL dquot in %s.", __func__);
goto next;
}
- if (item->ri_buf[i].i_len < sizeof(xfs_dqblk_t)) {
+ if (item->ri_buf[i].i_len < sizeof(xfs_disk_dquot_t)) {
cmn_err(CE_ALERT,
"XFS: dquot too small (%d) in %s.",
item->ri_buf[i].i_len, __func__);
@@ -2635,7 +2635,7 @@ xlog_recover_do_dquot_trans(
"XFS: NULL dquot in %s.", __func__);
return XFS_ERROR(EIO);
}
- if (item->ri_buf[1].i_len < sizeof(xfs_dqblk_t)) {
+ if (item->ri_buf[1].i_len < sizeof(xfs_disk_dquot_t)) {
cmn_err(CE_ALERT,
"XFS: dquot too small (%d) in %s.",
item->ri_buf[1].i_len, __func__);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 73e9b64..e2eeaa5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2296,6 +2296,7 @@ extern const struct inode_operations page_symlink_inode_operations;
extern int generic_readlink(struct dentry *, char __user *, int);
extern void generic_fillattr(struct inode *, struct kstat *);
extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
+void __inode_add_bytes(struct inode *inode, loff_t bytes);
void inode_add_bytes(struct inode *inode, loff_t bytes);
void inode_sub_bytes(struct inode *inode, loff_t bytes);
loff_t inode_get_bytes(struct inode *inode);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 78c4889..8fd8efc 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -313,8 +313,9 @@ struct dquot_operations {
int (*claim_space) (struct inode *, qsize_t);
/* release rsved quota for delayed alloc */
void (*release_rsv) (struct inode *, qsize_t);
- /* get reserved quota for delayed alloc */
- qsize_t (*get_reserved_space) (struct inode *);
+ /* get reserved quota for delayed alloc, value returned is managed by
+ * quota code only */
+ qsize_t *(*get_reserved_space) (struct inode *);
};

/* Operations handling requests from userspace */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index f27fd83..2c16189 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -354,8 +354,15 @@ static inline int ipv6_prefix_equal(const struct in6_addr *a1,

struct inet_frag_queue;

+enum ip6_defrag_users {
+ IP6_DEFRAG_LOCAL_DELIVER,
+ IP6_DEFRAG_CONNTRACK_IN,
+ IP6_DEFRAG_CONNTRACK_OUT,
+};
+
struct ip6_create_arg {
__be32 id;
+ u32 user;
struct in6_addr *src;
struct in6_addr *dst;
};
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
index abc55ad..1ee717e 100644
--- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
+++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
@@ -9,7 +9,7 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6;

extern int nf_ct_frag6_init(void);
extern void nf_ct_frag6_cleanup(void);
-extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb);
+extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user);
extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb,
struct net_device *in,
struct net_device *out,
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 620b58a..9484be4 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -237,8 +237,9 @@ void clockevents_exchange_device(struct clock_event_device *old,
*/
void clockevents_notify(unsigned long reason, void *arg)
{
- struct list_head *node, *tmp;
+ struct clock_event_device *dev, *tmp;
unsigned long flags;
+ int cpu;

spin_lock_irqsave(&clockevents_lock, flags);
clockevents_do_notify(reason, arg);
@@ -249,8 +250,19 @@ void clockevents_notify(unsigned long reason, void *arg)
* Unregister the clock event devices which were
* released from the users in the notify chain.
*/
- list_for_each_safe(node, tmp, &clockevents_released)
- list_del(node);
+ list_for_each_entry_safe(dev, tmp, &clockevents_released, list)
+ list_del(&dev->list);
+ /*
+ * Now check whether the CPU has left unused per cpu devices
+ */
+ cpu = *((int *)arg);
+ list_for_each_entry_safe(dev, tmp, &clockevent_devices, list) {
+ if (cpumask_test_cpu(cpu, dev->cpumask) &&
+ cpumask_weight(dev->cpumask) == 1) {
+ BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
+ list_del(&dev->list);
+ }
+ }
break;
default:
break;
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index fd4529d..566925e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -496,7 +496,13 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem)
task_unlock(task);
if (!curr)
return 0;
- if (curr->use_hierarchy)
+ /*
+ * We should check use_hierarchy of "mem" not "curr". Because checking
+ * use_hierarchy of "curr" here make this function true if hierarchy is
+ * enabled in "curr" and "curr" is a child of "mem" in *cgroup*
+ * hierarchy(even if use_hierarchy is disabled in "mem").
+ */
+ if (mem->use_hierarchy)
ret = css_is_ancestor(&curr->css, &mem->css);
else
ret = (curr == mem);
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index a7b2460..ed452e9 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -400,7 +400,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
cpuset_print_task_mems_allowed(current);
task_unlock(current);
dump_stack();
- mem_cgroup_print_oom_info(mem, current);
+ mem_cgroup_print_oom_info(mem, p);
show_mem();
if (sysctl_oom_dump_tasks)
dump_tasks(mem);
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 2a15c2d..5cdf423 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -183,6 +183,16 @@ out:
return nf_conntrack_confirm(skb);
}

+static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum,
+ struct sk_buff *skb)
+{
+ if (hooknum == NF_INET_PRE_ROUTING)
+ return IP6_DEFRAG_CONNTRACK_IN;
+ else
+ return IP6_DEFRAG_CONNTRACK_OUT;
+
+}
+
static unsigned int ipv6_defrag(unsigned int hooknum,
struct sk_buff *skb,
const struct net_device *in,
@@ -195,8 +205,7 @@ static unsigned int ipv6_defrag(unsigned int hooknum,
if (skb->nfct)
return NF_ACCEPT;

- reasm = nf_ct_frag6_gather(skb);
-
+ reasm = nf_ct_frag6_gather(skb, nf_ct6_defrag_user(hooknum, skb));
/* queued */
if (reasm == NULL)
return NF_STOLEN;
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index f3aba25..4b6a539 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -170,13 +170,14 @@ out:
/* Creation primitives. */

static __inline__ struct nf_ct_frag6_queue *
-fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst)
+fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst)
{
struct inet_frag_queue *q;
struct ip6_create_arg arg;
unsigned int hash;

arg.id = id;
+ arg.user = user;
arg.src = src;
arg.dst = dst;

@@ -561,7 +562,7 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
return 0;
}

-struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
+struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user)
{
struct sk_buff *clone;
struct net_device *dev = skb->dev;
@@ -607,7 +608,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
if (atomic_read(&nf_init_frags.mem) > nf_init_frags.high_thresh)
nf_ct_frag6_evictor();

- fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr);
+ fq = fq_find(fhdr->identification, user, &hdr->saddr, &hdr->daddr);
if (fq == NULL) {
pr_debug("Can't find and can't create new queue\n");
goto ret_orig;
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 2642a41..6a36f13 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -72,6 +72,7 @@ struct frag_queue
struct inet_frag_queue q;

__be32 id; /* fragment id */
+ u32 user;
struct in6_addr saddr;
struct in6_addr daddr;

@@ -141,7 +142,7 @@ int ip6_frag_match(struct inet_frag_queue *q, void *a)
struct ip6_create_arg *arg = a;

fq = container_of(q, struct frag_queue, q);
- return (fq->id == arg->id &&
+ return (fq->id == arg->id && fq->user == arg->user &&
ipv6_addr_equal(&fq->saddr, arg->src) &&
ipv6_addr_equal(&fq->daddr, arg->dst));
}
@@ -163,6 +164,7 @@ void ip6_frag_init(struct inet_frag_queue *q, void *a)
struct ip6_create_arg *arg = a;

fq->id = arg->id;
+ fq->user = arg->user;
ipv6_addr_copy(&fq->saddr, arg->src);
ipv6_addr_copy(&fq->daddr, arg->dst);
}
@@ -244,6 +246,7 @@ fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst,
unsigned int hash;

arg.id = id;
+ arg.user = IP6_DEFRAG_LOCAL_DELIVER;
arg.src = src;
arg.dst = dst;

diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
index e497525..db7ff29 100644
--- a/sound/mips/sgio2audio.c
+++ b/sound/mips/sgio2audio.c
@@ -609,7 +609,7 @@ static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream,
/* alloc virtual 'dma' area */
if (runtime->dma_area)
vfree(runtime->dma_area);
- runtime->dma_area = vmalloc(size);
+ runtime->dma_area = vmalloc_user(size);
if (runtime->dma_area == NULL)
return -ENOMEM;
runtime->dma_bytes = size;
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
index d057e64..5cfa608 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
@@ -51,7 +51,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
return 0; /* already enough large */
vfree(runtime->dma_area);
}
- runtime->dma_area = vmalloc_32(size);
+ runtime->dma_area = vmalloc_32_user(size);
if (! runtime->dma_area)
return -ENOMEM;
runtime->dma_bytes = size;
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 1fd4e88..e9123f5 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -464,7 +464,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
{
u16 *cache = codec->reg_cache;

- soc_ac97_ops.write(codec->ac97, reg, val);
+ if (reg < 0x7c)
+ soc_ac97_ops.write(codec->ac97, reg, val);
reg = reg >> 1;
if (reg < (ARRAY_SIZE(wm9712_reg)))
cache[reg] = val;
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 44b9cdc..b70527a 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -752,7 +752,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
return 0; /* already large enough */
vfree(runtime->dma_area);
}
- runtime->dma_area = vmalloc(size);
+ runtime->dma_area = vmalloc_user(size);
if (!runtime->dma_area)
return -ENOMEM;
runtime->dma_bytes = size;

2010-01-07 14:33:47

by Thomas Voegtle

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

Hi,

On Wed, 6 Jan 2010, Greg KH wrote:
> I'm announcing the release of the 2.6.31.10 kernel. All users of the
> 2.6.31 kernel series are very strongly encouraged to upgrade.


Something broken here, during using a suse 11.2 installation with quota
switched on (this is reproducible )


------------[ cut here ]------------
kernel BUG at fs/quota/dquot.c:1398!
invalid opcode: 0000 [#1]
last sysfs file: /sys/devices/pci0000:00/0000:00:1f.5/modalias

Pid: 3037, comm: rpm Not tainted (2.6.31.10-BIG #1) P3TSSA
EIP: 0060:[<c10b871e>] EFLAGS: 00010246 CPU: 0
EIP is at inode_reserved_space+0x23/0x3e
EAX: c1855c3c EBX: d608ff4c ECX: d462307c EDX: 00000000
ESI: 00000001 EDI: d462307c EBP: d608feac ESP: d608fea8
DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
Process rpm (pid: 3037, ti=d608f000 task=d710afc0 task.ti=d608f000)
Stack:
09a0c500 d608fefc c10badb1 d462307c 000000e4 d796e000 00000000 00000000
<0> 00000002 d608fee4 00000000 00000000 d44055a0 00000000 00000000
d4405320
<0> 00005140 09a0c500 d462307c d608ff4c d462307c d608ff10 c10b87a6
09a0c500
Call Trace:
[<c10badb1>] ? dquot_transfer+0x106/0x30f
[<c10b87a6>] ? vfs_dq_transfer+0x6d/0x9c
[<c10956f3>] ? notify_change+0x190/0x295
[<c108202a>] ? chown_common+0x65/0x88
[<c1604af2>] ? schedule+0x3df/0x40c
[<c10821c5>] ? sys_lchown+0x4e/0x7b
[<c1002b1b>] ? sysenter_do_call+0x12/0x26
Code: 05 e8 5e 85 f7 ff c9 c3 55 89 c1 89 e5 83 ec 04 65 a1 14 00 00 00 89
45 fc 31 c0 8b 81 90 00 00 00 8b 40 24 8b 50 44 85 d2 75 04 <0f> 0b eb fe
89 c8 ff d2 8b
55 fc 65 33 15 14 00 00 00 74 05 e8
EIP: [<c10b871e>] inode_reserved_space+0x23/0x3e SS:ESP 0068:d608fea8
---[ end trace 575c2988a2722de1 ]---

2010-01-07 18:05:33

by Greg KH

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

On Thu, Jan 07, 2010 at 03:27:21PM +0100, Thomas Voegtle wrote:
> Hi,
>
> On Wed, 6 Jan 2010, Greg KH wrote:
> > I'm announcing the release of the 2.6.31.10 kernel. All users of the
> > 2.6.31 kernel series are very strongly encouraged to upgrade.
>
>
> Something broken here, during using a suse 11.2 installation with quota
> switched on (this is reproducible )

Jan, this looks like something in the quota patches you sent. Any
ideas?

Thomas, is this on an ext3 or ext4 partition, or something else?

thanks,

greg k-h

>
>
> ------------[ cut here ]------------
> kernel BUG at fs/quota/dquot.c:1398!
> invalid opcode: 0000 [#1]
> last sysfs file: /sys/devices/pci0000:00/0000:00:1f.5/modalias
>
> Pid: 3037, comm: rpm Not tainted (2.6.31.10-BIG #1) P3TSSA
> EIP: 0060:[<c10b871e>] EFLAGS: 00010246 CPU: 0
> EIP is at inode_reserved_space+0x23/0x3e
> EAX: c1855c3c EBX: d608ff4c ECX: d462307c EDX: 00000000
> ESI: 00000001 EDI: d462307c EBP: d608feac ESP: d608fea8
> DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
> Process rpm (pid: 3037, ti=d608f000 task=d710afc0 task.ti=d608f000)
> Stack:
> 09a0c500 d608fefc c10badb1 d462307c 000000e4 d796e000 00000000 00000000
> <0> 00000002 d608fee4 00000000 00000000 d44055a0 00000000 00000000
> d4405320
> <0> 00005140 09a0c500 d462307c d608ff4c d462307c d608ff10 c10b87a6
> 09a0c500
> Call Trace:
> [<c10badb1>] ? dquot_transfer+0x106/0x30f
> [<c10b87a6>] ? vfs_dq_transfer+0x6d/0x9c
> [<c10956f3>] ? notify_change+0x190/0x295
> [<c108202a>] ? chown_common+0x65/0x88
> [<c1604af2>] ? schedule+0x3df/0x40c
> [<c10821c5>] ? sys_lchown+0x4e/0x7b
> [<c1002b1b>] ? sysenter_do_call+0x12/0x26
> Code: 05 e8 5e 85 f7 ff c9 c3 55 89 c1 89 e5 83 ec 04 65 a1 14 00 00 00 89
> 45 fc 31 c0 8b 81 90 00 00 00 8b 40 24 8b 50 44 85 d2 75 04 <0f> 0b eb fe
> 89 c8 ff d2 8b
> 55 fc 65 33 15 14 00 00 00 74 05 e8
> EIP: [<c10b871e>] inode_reserved_space+0x23/0x3e SS:ESP 0068:d608fea8
> ---[ end trace 575c2988a2722de1 ]---
>

2010-01-07 18:12:16

by Teck Choon Giam

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

> Something broken here, during using a suse 11.2 installation with quota
> switched on (this is reproducible )
>
>
> ------------[ cut here ]------------
> kernel BUG at fs/quota/dquot.c:1398!
> invalid opcode: 0000 [#1]
> last sysfs file: /sys/devices/pci0000:00/0000:00:1f.5/modalias
>
> Pid: 3037, comm: rpm Not tainted (2.6.31.10-BIG #1) P3TSSA
> EIP: 0060:[<c10b871e>] EFLAGS: 00010246 CPU: 0
> EIP is at inode_reserved_space+0x23/0x3e
> EAX: c1855c3c EBX: d608ff4c ECX: d462307c EDX: 00000000
> ESI: 00000001 EDI: d462307c EBP: d608feac ESP: d608fea8
> ?DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
> Process rpm (pid: 3037, ti=d608f000 task=d710afc0 task.ti=d608f000)
> Stack:
> ?09a0c500 d608fefc c10badb1 d462307c 000000e4 d796e000 00000000 00000000
> <0> 00000002 d608fee4 00000000 00000000 d44055a0 00000000 00000000 d4405320
> <0> 00005140 09a0c500 d462307c d608ff4c d462307c d608ff10 c10b87a6 09a0c500
> Call Trace:
> ?[<c10badb1>] ? dquot_transfer+0x106/0x30f
> ?[<c10b87a6>] ? vfs_dq_transfer+0x6d/0x9c
> ?[<c10956f3>] ? notify_change+0x190/0x295
> ?[<c108202a>] ? chown_common+0x65/0x88
> ?[<c1604af2>] ? schedule+0x3df/0x40c
> ?[<c10821c5>] ? sys_lchown+0x4e/0x7b
> ?[<c1002b1b>] ? sysenter_do_call+0x12/0x26
> Code: 05 e8 5e 85 f7 ff c9 c3 55 89 c1 89 e5 83 ec 04 65 a1 14 00 00 00 89
> 45 fc 31 c0 8b 81 90 00 00 00 8b 40 24 8b 50 44 85 d2 75 04 <0f> 0b eb fe 89
> c8 ff d2 8b
> 55 fc 65 33 15 14 00 00 00 74 05 e8
> EIP: [<c10b871e>] inode_reserved_space+0x23/0x3e SS:ESP 0068:d608fea8
> ---[ end trace 575c2988a2722de1 ]---

I got similar issue like above for CentOS 4 and 5. This also
happening for linux-2.6.32.3 which I just tested for a system DELL
PE850 with CentOS 4. FYI please.

Thanks.

Kindest regards,
Giam Teck Choon

2010-01-07 19:36:12

by Thomas Voegtle

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

On Thu, 7 Jan 2010, Greg KH wrote:

> On Thu, Jan 07, 2010 at 03:27:21PM +0100, Thomas Voegtle wrote:
>> Hi,
>>
>> On Wed, 6 Jan 2010, Greg KH wrote:
>>> I'm announcing the release of the 2.6.31.10 kernel. All users of the
>>> 2.6.31 kernel series are very strongly encouraged to upgrade.
>>
>>
>> Something broken here, during using a suse 11.2 installation with quota
>> switched on (this is reproducible )
>
> Jan, this looks like something in the quota patches you sent. Any
> ideas?
>
> Thomas, is this on an ext3 or ext4 partition, or something else?


The one with quota enabled was an ext3 partition, mounted on /


thanks,
Thomas

2010-01-07 19:42:13

by Greg KH

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

On Thu, Jan 07, 2010 at 08:36:07PM +0100, Thomas Voegtle wrote:
> On Thu, 7 Jan 2010, Greg KH wrote:
>
> > On Thu, Jan 07, 2010 at 03:27:21PM +0100, Thomas Voegtle wrote:
> >> Hi,
> >>
> >> On Wed, 6 Jan 2010, Greg KH wrote:
> >>> I'm announcing the release of the 2.6.31.10 kernel. All users of the
> >>> 2.6.31 kernel series are very strongly encouraged to upgrade.
> >>
> >>
> >> Something broken here, during using a suse 11.2 installation with quota
> >> switched on (this is reproducible )
> >
> > Jan, this looks like something in the quota patches you sent. Any
> > ideas?
> >
> > Thomas, is this on an ext3 or ext4 partition, or something else?
>
>
> The one with quota enabled was an ext3 partition, mounted on /

Thanks.

Could you run 'git bisect' between the two kernel versions to try to
track the problem down to the single patch?

thanks,

greg k-h

2010-01-07 20:33:36

by Thomas Voegtle

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

On Thu, 7 Jan 2010, Greg KH wrote:

> On Thu, Jan 07, 2010 at 08:36:07PM +0100, Thomas Voegtle wrote:
>> On Thu, 7 Jan 2010, Greg KH wrote:
>>
>>> On Thu, Jan 07, 2010 at 03:27:21PM +0100, Thomas Voegtle wrote:
>>>> Hi,
>>>>
>>>> On Wed, 6 Jan 2010, Greg KH wrote:
>>>>> I'm announcing the release of the 2.6.31.10 kernel. All users of the
>>>>> 2.6.31 kernel series are very strongly encouraged to upgrade.
>>>>
>>>>
>>>> Something broken here, during using a suse 11.2 installation with quota
>>>> switched on (this is reproducible )
>>>
>>> Jan, this looks like something in the quota patches you sent. Any
>>> ideas?
>>>
>>> Thomas, is this on an ext3 or ext4 partition, or something else?
>>
>>
>> The one with quota enabled was an ext3 partition, mounted on /
>
> Thanks.
>
> Could you run 'git bisect' between the two kernel versions to try to
> track the problem down to the single patch?

Done, between 2.6.31.9 and 2.6.31.11


c169e13a6662cbf36fc0098508e7aa31b49cbf23 is first bad commit
commit c169e13a6662cbf36fc0098508e7aa31b49cbf23
Author: Dmitry Monakhov <[email protected]>
Date: Mon Dec 14 15:21:13 2009 +0300

quota: decouple fs reserved space from quota reservation

commit fd8fbfc1709822bd94247c5b2ab15a5f5041e103 upstream.



Reverting that patch on top of 2.6.31.11 fixes the problem for me.

2010-01-07 20:42:56

by Thomas Voegtle

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

On Thu, 7 Jan 2010, Thomas Voegtle wrote:

> Done, between 2.6.31.9 and 2.6.31.11
>
>
> c169e13a6662cbf36fc0098508e7aa31b49cbf23 is first bad commit
> commit c169e13a6662cbf36fc0098508e7aa31b49cbf23
> Author: Dmitry Monakhov <[email protected]>
> Date: Mon Dec 14 15:21:13 2009 +0300
>
> quota: decouple fs reserved space from quota reservation
>
> commit fd8fbfc1709822bd94247c5b2ab15a5f5041e103 upstream.
>
>
>
> Reverting that patch on top of 2.6.31.11 fixes the problem for me.


Funny thing, I have the problem with 2.6.33-rc3, too:


------------[ cut here ]------------
kernel BUG at fs/quota/dquot.c:1350!
invalid opcode: 0000 [#1]
last sysfs file: /sys/devices/pci0000:00/0000:00:1f.5/modalias

Pid: 3061, comm: rpm Not tainted 2.6.33-rc3-BIG #73 P3TSSA/P3TSSA
EIP: 0060:[<c10c05d8>] EFLAGS: 00010246 CPU: 0
EIP is at inode_reserved_space+0x13/0x1b
EAX: cf25b5c4 EBX: cf25b5c4 ECX: 00000000 EDX: 00000000
ESI: cf25b5c4 EDI: 00000000 EBP: d3536ebc ESP: d3536ebc
DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
Process rpm (pid: 3061, ti=d3536000 task=d5c50000 task.ti=d3536000)
Stack:
d3536f1c c10c246a d79a4b00 d3536edc c10a4884 d3536ef4 c10c1fea 00000000
<0> 00000000 00000000 00000064 cf25b5c4 cf25b5c4 d701c800 d3536f1c
00000000
<0> d766b000 00000000 00000000 d766b0a0 0000b140 cf25b5c4 d3536f58
ffffff86
Call Trace:
[<c10c246a>] ? dquot_transfer+0xf2/0x48b
[<c10a4884>] ? mntput_no_expire+0x19/0x6c
[<c10c1fea>] ? dqget+0x210/0x260
[<c10c05aa>] ? vfs_dq_transfer+0x5f/0x7a
[<c10a2edd>] ? notify_change+0x177/0x25e
[<c10930c8>] ? chown_common+0x5e/0x70
[<c10931fe>] ? sys_lchown+0x3d/0x58
[<c10212a7>] ? sysenter_do_call+0x12/0x2c
Code: c0 0f b6 c0 eb 02 31 c0 5b 5e 5d c3 a8 08 75 b0 eb f4 a8 08 75 c9 eb
d5 55 8b 90 90 00 00 00 89 e5 8b 52 24 8b 52 44 85 d2 75 04 <0f> 0b eb fe
ff d2 5d c3 55 89 e5 57 89 c7 56 53 83 ec 1c 8b 35
EIP: [<c10c05d8>] inode_reserved_space+0x13/0x1b SS:ESP 0068:d3536ebc
---[ end trace 0cbcf5a4693c0845 ]---

2010-01-07 22:16:41

by Greg KH

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

On Thu, Jan 07, 2010 at 09:42:52PM +0100, Thomas Voegtle wrote:
> On Thu, 7 Jan 2010, Thomas Voegtle wrote:
>
>> Done, between 2.6.31.9 and 2.6.31.11
>>
>>
>> c169e13a6662cbf36fc0098508e7aa31b49cbf23 is first bad commit
>> commit c169e13a6662cbf36fc0098508e7aa31b49cbf23
>> Author: Dmitry Monakhov <[email protected]>
>> Date: Mon Dec 14 15:21:13 2009 +0300
>>
>> quota: decouple fs reserved space from quota reservation
>>
>> commit fd8fbfc1709822bd94247c5b2ab15a5f5041e103 upstream.
>>
>>
>>
>> Reverting that patch on top of 2.6.31.11 fixes the problem for me.
>
>
> Funny thing, I have the problem with 2.6.33-rc3, too:
>
>
> ------------[ cut here ]------------
> kernel BUG at fs/quota/dquot.c:1350!
> invalid opcode: 0000 [#1]
> last sysfs file: /sys/devices/pci0000:00/0000:00:1f.5/modalias
>
> Pid: 3061, comm: rpm Not tainted 2.6.33-rc3-BIG #73 P3TSSA/P3TSSA
> EIP: 0060:[<c10c05d8>] EFLAGS: 00010246 CPU: 0
> EIP is at inode_reserved_space+0x13/0x1b
> EAX: cf25b5c4 EBX: cf25b5c4 ECX: 00000000 EDX: 00000000
> ESI: cf25b5c4 EDI: 00000000 EBP: d3536ebc ESP: d3536ebc
> DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
> Process rpm (pid: 3061, ti=d3536000 task=d5c50000 task.ti=d3536000)
> Stack:
> d3536f1c c10c246a d79a4b00 d3536edc c10a4884 d3536ef4 c10c1fea 00000000
> <0> 00000000 00000000 00000064 cf25b5c4 cf25b5c4 d701c800 d3536f1c 00000000
> <0> d766b000 00000000 00000000 d766b0a0 0000b140 cf25b5c4 d3536f58 ffffff86
> Call Trace:
> [<c10c246a>] ? dquot_transfer+0xf2/0x48b
> [<c10a4884>] ? mntput_no_expire+0x19/0x6c
> [<c10c1fea>] ? dqget+0x210/0x260
> [<c10c05aa>] ? vfs_dq_transfer+0x5f/0x7a
> [<c10a2edd>] ? notify_change+0x177/0x25e
> [<c10930c8>] ? chown_common+0x5e/0x70
> [<c10931fe>] ? sys_lchown+0x3d/0x58
> [<c10212a7>] ? sysenter_do_call+0x12/0x2c
> Code: c0 0f b6 c0 eb 02 31 c0 5b 5e 5d c3 a8 08 75 b0 eb f4 a8 08 75 c9 eb
> d5 55 8b 90 90 00 00 00 89 e5 8b 52 24 8b 52 44 85 d2 75 04 <0f> 0b eb fe
> ff d2 5d c3 55 89 e5 57 89 c7 56 53 83 ec 1c 8b 35
> EIP: [<c10c05d8>] inode_reserved_space+0x13/0x1b SS:ESP 0068:d3536ebc
> ---[ end trace 0cbcf5a4693c0845 ]---

Well, that's good, at least things are now consistant :)

Jan, I think this is all yours...

greg k-h

2010-01-08 00:03:34

by Dmitry Monakhov

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

2010/1/8 Greg KH <[email protected]>:
> On Thu, Jan 07, 2010 at 09:42:52PM +0100, Thomas Voegtle wrote:
>> On Thu, 7 Jan 2010, Thomas Voegtle wrote:
>>
>>> Done, between 2.6.31.9 and 2.6.31.11
>>>
>>>
>>> c169e13a6662cbf36fc0098508e7aa31b49cbf23 is first bad commit
>>> commit c169e13a6662cbf36fc0098508e7aa31b49cbf23
>>> Author: Dmitry Monakhov <[email protected]>
>>> Date:   Mon Dec 14 15:21:13 2009 +0300
>>>
>>>    quota: decouple fs reserved space from quota reservation
>>>
>>>    commit fd8fbfc1709822bd94247c5b2ab15a5f5041e103 upstream.
Ohhh No...
This is totaly my fault. after some cleanups i've forgot to test
ext3+quota scenario :( . The error is trivial, it is too sad what this
error
was found this late.'
calltrace:
->chown
->dquot_transfer
->inode_get_rsv_space
static qsize_t inode_get_rsv_space(struct inode *inode)
1378 {
1379 qsize_t ret;
<<< This is illigal to call this function from fs which has no quota
reservation support.
so we have to add simple if statment here like this .
if (!inode->i_sb->dq_op->get_reserved_space)
/* quota reservation is no supported */
return 0;
1380 spin_lock(&inode->i_lock);
1381 ret = *inode_reserved_space(inode);
1382 spin_unlock(&inode->i_lock);
1383 return ret;
1384 }

Will send patch in a minute.
>>>
>>>
>>>
>>> Reverting that patch on top of 2.6.31.11 fixes the problem for me.
>>
>>
>> Funny thing, I have the problem with 2.6.33-rc3, too:
>>
>>
>> ------------[ cut here ]------------
>> kernel BUG at fs/quota/dquot.c:1350!
>> invalid opcode: 0000 [#1]
>> last sysfs file: /sys/devices/pci0000:00/0000:00:1f.5/modalias
>>
>> Pid: 3061, comm: rpm Not tainted 2.6.33-rc3-BIG #73 P3TSSA/P3TSSA
>> EIP: 0060:[<c10c05d8>] EFLAGS: 00010246 CPU: 0
>> EIP is at inode_reserved_space+0x13/0x1b
>> EAX: cf25b5c4 EBX: cf25b5c4 ECX: 00000000 EDX: 00000000
>> ESI: cf25b5c4 EDI: 00000000 EBP: d3536ebc ESP: d3536ebc
>>  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
>> Process rpm (pid: 3061, ti=d3536000 task=d5c50000 task.ti=d3536000)
>> Stack:
>>  d3536f1c c10c246a d79a4b00 d3536edc c10a4884 d3536ef4 c10c1fea 00000000
>> <0> 00000000 00000000 00000064 cf25b5c4 cf25b5c4 d701c800 d3536f1c 00000000
>> <0> d766b000 00000000 00000000 d766b0a0 0000b140 cf25b5c4 d3536f58 ffffff86
>> Call Trace:
>>  [<c10c246a>] ? dquot_transfer+0xf2/0x48b
>>  [<c10a4884>] ? mntput_no_expire+0x19/0x6c
>>  [<c10c1fea>] ? dqget+0x210/0x260
>>  [<c10c05aa>] ? vfs_dq_transfer+0x5f/0x7a
>>  [<c10a2edd>] ? notify_change+0x177/0x25e
>>  [<c10930c8>] ? chown_common+0x5e/0x70
>>  [<c10931fe>] ? sys_lchown+0x3d/0x58
>>  [<c10212a7>] ? sysenter_do_call+0x12/0x2c
>> Code: c0 0f b6 c0 eb 02 31 c0 5b 5e 5d c3 a8 08 75 b0 eb f4 a8 08 75 c9 eb
>> d5 55 8b 90 90 00 00 00 89 e5 8b 52 24 8b 52 44 85 d2 75 04 <0f> 0b eb fe
>> ff d2 5d c3 55 89 e5 57 89 c7 56 53 83 ec 1c 8b 35
>> EIP: [<c10c05d8>] inode_reserved_space+0x13/0x1b SS:ESP 0068:d3536ebc
>> ---[ end trace 0cbcf5a4693c0845 ]---
>
> Well, that's good, at least things are now consistant :)
>
> Jan, I think this is all yours...
>
> greg k-h
>

2010-01-08 00:54:04

by Dmitry Monakhov

[permalink] [raw]
Subject: [PATCH] quota: fix reserved space management for ordinary fs


In fact inode_get_rsv_space() function is special in comparison
with inode_{add,sub,claim}_rsv_space() functions, because
it may return correct result even for fs without reserved space
support(correct val == 0). Add trivial check for that case.
The patch fix regression(BUG at fs/quota/dquot.c:1350) introduced
in following commit: fd8fbfc1709822bd94247c5b2ab15a5f5041e103

Signed-off-by: Dmitry Monakhov <[email protected]>
---
fs/quota/dquot.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index dea86ab..d9f06cf 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1377,6 +1377,8 @@ static void inode_sub_rsv_space(struct inode *inode, qsize_t number)
static qsize_t inode_get_rsv_space(struct inode *inode)
{
qsize_t ret;
+ if (!inode->i_sb->dq_op->get_reserved_space)
+ return 0;
spin_lock(&inode->i_lock);
ret = *inode_reserved_space(inode);
spin_unlock(&inode->i_lock);
--
1.6.3.3


2010-01-08 11:03:12

by Thomas Voegtle

[permalink] [raw]
Subject: Re: [PATCH] quota: fix reserved space management for ordinary fs

On Fri, 8 Jan 2010, Dmitry Monakhov wrote:

>
> In fact inode_get_rsv_space() function is special in comparison
> with inode_{add,sub,claim}_rsv_space() functions, because
> it may return correct result even for fs without reserved space
> support(correct val == 0). Add trivial check for that case.
> The patch fix regression(BUG at fs/quota/dquot.c:1350) introduced
> in following commit: fd8fbfc1709822bd94247c5b2ab15a5f5041e103
>
> Signed-off-by: Dmitry Monakhov <[email protected]>
> ---
> fs/quota/dquot.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> index dea86ab..d9f06cf 100644
> --- a/fs/quota/dquot.c
> +++ b/fs/quota/dquot.c
> @@ -1377,6 +1377,8 @@ static void inode_sub_rsv_space(struct inode *inode, qsize_t number)
> static qsize_t inode_get_rsv_space(struct inode *inode)
> {
> qsize_t ret;
> + if (!inode->i_sb->dq_op->get_reserved_space)
> + return 0;
> spin_lock(&inode->i_lock);
> ret = *inode_reserved_space(inode);
> spin_unlock(&inode->i_lock);
>

Patch works for me on top of 2.6.33-rc3 and on top of 2.6.31.11.

Thanks,

Thomas

2010-01-08 12:24:06

by Teck Choon Giam

[permalink] [raw]
Subject: Re: [PATCH] quota: fix reserved space management for ordinary fs

> Patch works for me on top of 2.6.33-rc3 and on top of 2.6.31.11.

Also works for 2.6.32.3.

Thanks!

Kindest regards,
Giam Teck Choon

2010-01-08 12:39:15

by Jan Kara

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

On Fri 08-01-10 03:03:30, Dmitry Monakhov wrote:
> 2010/1/8 Greg KH <[email protected]>:
> > On Thu, Jan 07, 2010 at 09:42:52PM +0100, Thomas Voegtle wrote:
> >> On Thu, 7 Jan 2010, Thomas Voegtle wrote:
> >>
> >>> Done, between 2.6.31.9 and 2.6.31.11
> >>>
> >>>
> >>> c169e13a6662cbf36fc0098508e7aa31b49cbf23 is first bad commit
> >>> commit c169e13a6662cbf36fc0098508e7aa31b49cbf23
> >>> Author: Dmitry Monakhov <[email protected]>
> >>> Date: ? Mon Dec 14 15:21:13 2009 +0300
> >>>
> >>> ? ?quota: decouple fs reserved space from quota reservation
> >>>
> >>> ? ?commit fd8fbfc1709822bd94247c5b2ab15a5f5041e103 upstream.
> Ohhh No...
> This is totaly my fault. after some cleanups i've forgot to test
> ext3+quota scenario :( . The error is trivial, it is too sad what this
> error
> was found this late.'
> calltrace:
> ->chown
> ->dquot_transfer
> ->inode_get_rsv_space
Yeah, it's also my fault because I've tested your patches only with ext4
so this was not uncovered. I've actually noticed the bug on Wednesday
evening (and fixed it in my tree) but forgot to push it do stable :(

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR

2010-01-08 12:41:40

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH] quota: fix reserved space management for ordinary fs

On Fri 08-01-10 03:53:54, Dmitry Monakhov wrote:
>
> In fact inode_get_rsv_space() function is special in comparison
> with inode_{add,sub,claim}_rsv_space() functions, because
> it may return correct result even for fs without reserved space
> support(correct val == 0). Add trivial check for that case.
> The patch fix regression(BUG at fs/quota/dquot.c:1350) introduced
> in following commit: fd8fbfc1709822bd94247c5b2ab15a5f5041e103
>
> Signed-off-by: Dmitry Monakhov <[email protected]>
Acked-by: Jan Kara <[email protected]>

Greg, please merge this patch to stable series. I'll push the same
patch I have in my tree to Linus on Monday.

Honza
> ---
> fs/quota/dquot.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> index dea86ab..d9f06cf 100644
> --- a/fs/quota/dquot.c
> +++ b/fs/quota/dquot.c
> @@ -1377,6 +1377,8 @@ static void inode_sub_rsv_space(struct inode *inode, qsize_t number)
> static qsize_t inode_get_rsv_space(struct inode *inode)
> {
> qsize_t ret;
> + if (!inode->i_sb->dq_op->get_reserved_space)
> + return 0;
> spin_lock(&inode->i_lock);
> ret = *inode_reserved_space(inode);
> spin_unlock(&inode->i_lock);
> --
> 1.6.3.3
>
>
>
--
Jan Kara <[email protected]>
SUSE Labs, CR

2010-01-08 15:53:01

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] quota: fix reserved space management for ordinary fs

On Fri, Jan 08, 2010 at 01:41:39PM +0100, Jan Kara wrote:
> On Fri 08-01-10 03:53:54, Dmitry Monakhov wrote:
> >
> > In fact inode_get_rsv_space() function is special in comparison
> > with inode_{add,sub,claim}_rsv_space() functions, because
> > it may return correct result even for fs without reserved space
> > support(correct val == 0). Add trivial check for that case.
> > The patch fix regression(BUG at fs/quota/dquot.c:1350) introduced
> > in following commit: fd8fbfc1709822bd94247c5b2ab15a5f5041e103
> >
> > Signed-off-by: Dmitry Monakhov <[email protected]>
> Acked-by: Jan Kara <[email protected]>
>
> Greg, please merge this patch to stable series. I'll push the same
> patch I have in my tree to Linus on Monday.

I can't merge it to the -stable tree until it shows up in Linus's tree,
so I'll wait for that to happen.

thanks,

greg k-h

2010-01-12 12:23:46

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH] quota: fix reserved space management for ordinary fs

On Fri 08-01-10 07:52:15, Greg KH wrote:
> On Fri, Jan 08, 2010 at 01:41:39PM +0100, Jan Kara wrote:
> > On Fri 08-01-10 03:53:54, Dmitry Monakhov wrote:
> > >
> > > In fact inode_get_rsv_space() function is special in comparison
> > > with inode_{add,sub,claim}_rsv_space() functions, because
> > > it may return correct result even for fs without reserved space
> > > support(correct val == 0). Add trivial check for that case.
> > > The patch fix regression(BUG at fs/quota/dquot.c:1350) introduced
> > > in following commit: fd8fbfc1709822bd94247c5b2ab15a5f5041e103
> > >
> > > Signed-off-by: Dmitry Monakhov <[email protected]>
> > Acked-by: Jan Kara <[email protected]>
> >
> > Greg, please merge this patch to stable series. I'll push the same
> > patch I have in my tree to Linus on Monday.
>
> I can't merge it to the -stable tree until it shows up in Linus's tree,
> so I'll wait for that to happen.
OK, Linus has pulled. It's commit
05b5d898235401c489c68e1f3bc5706a29ad5713. Please include it in both stable
trees that have the commit fd8fbfc1709822bd94247c5b2ab15a5f5041e103.
Thanks!

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR

2010-01-12 14:26:12

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] quota: fix reserved space management for ordinary fs

On Tue, Jan 12, 2010 at 01:23:46PM +0100, Jan Kara wrote:
> On Fri 08-01-10 07:52:15, Greg KH wrote:
> > On Fri, Jan 08, 2010 at 01:41:39PM +0100, Jan Kara wrote:
> > > On Fri 08-01-10 03:53:54, Dmitry Monakhov wrote:
> > > >
> > > > In fact inode_get_rsv_space() function is special in comparison
> > > > with inode_{add,sub,claim}_rsv_space() functions, because
> > > > it may return correct result even for fs without reserved space
> > > > support(correct val == 0). Add trivial check for that case.
> > > > The patch fix regression(BUG at fs/quota/dquot.c:1350) introduced
> > > > in following commit: fd8fbfc1709822bd94247c5b2ab15a5f5041e103
> > > >
> > > > Signed-off-by: Dmitry Monakhov <[email protected]>
> > > Acked-by: Jan Kara <[email protected]>
> > >
> > > Greg, please merge this patch to stable series. I'll push the same
> > > patch I have in my tree to Linus on Monday.
> >
> > I can't merge it to the -stable tree until it shows up in Linus's tree,
> > so I'll wait for that to happen.
> OK, Linus has pulled. It's commit
> 05b5d898235401c489c68e1f3bc5706a29ad5713. Please include it in both stable
> trees that have the commit fd8fbfc1709822bd94247c5b2ab15a5f5041e103.

Great, will do.

thanks for the followup.

greg k-h

2010-01-13 21:15:05

by Ozan Çağlayan

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

Greg KH wrote:
> On Thu, Jan 07, 2010 at 09:42:52PM +0100, Thomas Voegtle wrote:
>> On Thu, 7 Jan 2010, Thomas Voegtle wrote:
>>


>> ------------[ cut here ]------------
>> kernel BUG at fs/quota/dquot.c:1350!
>> invalid opcode: 0000 [#1]
>> last sysfs file: /sys/devices/pci0000:00/0000:00:1f.5/modalias
>>
>> Pid: 3061, comm: rpm Not tainted 2.6.33-rc3-BIG #73 P3TSSA/P3TSSA
>> EIP: 0060:[<c10c05d8>] EFLAGS: 00010246 CPU: 0
>> EIP is at inode_reserved_space+0x13/0x1b
>> EAX: cf25b5c4 EBX: cf25b5c4 ECX: 00000000 EDX: 00000000
>> ESI: cf25b5c4 EDI: 00000000 EBP: d3536ebc ESP: d3536ebc
>> DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
>> Process rpm (pid: 3061, ti=d3536000 task=d5c50000 task.ti=d3536000)
>> Stack:
>> d3536f1c c10c246a d79a4b00 d3536edc c10a4884 d3536ef4 c10c1fea 00000000
>> <0> 00000000 00000000 00000064 cf25b5c4 cf25b5c4 d701c800 d3536f1c 00000000
>> <0> d766b000 00000000 00000000 d766b0a0 0000b140 cf25b5c4 d3536f58 ffffff86
>> Call Trace:
>> [<c10c246a>] ? dquot_transfer+0xf2/0x48b
>> [<c10a4884>] ? mntput_no_expire+0x19/0x6c
>> [<c10c1fea>] ? dqget+0x210/0x260
>> [<c10c05aa>] ? vfs_dq_transfer+0x5f/0x7a
>> [<c10a2edd>] ? notify_change+0x177/0x25e
>> [<c10930c8>] ? chown_common+0x5e/0x70
>> [<c10931fe>] ? sys_lchown+0x3d/0x58
>> [<c10212a7>] ? sysenter_do_call+0x12/0x2c
>> Code: c0 0f b6 c0 eb 02 31 c0 5b 5e 5d c3 a8 08 75 b0 eb f4 a8 08 75 c9 eb
>> d5 55 8b 90 90 00 00 00 89 e5 8b 52 24 8b 52 44 85 d2 75 04 <0f> 0b eb fe
>> ff d2 5d c3 55 89 e5 57 89 c7 56 53 83 ec 1c 8b 35
>> EIP: [<c10c05d8>] inode_reserved_space+0x13/0x1b SS:ESP 0068:d3536ebc
>> ---[ end trace 0cbcf5a4693c0845 ]---
>
> Well, that's good, at least things are now consistant :)
>


This causes kernel panic upon boot on one of our users' ext3 system (on 2.6.31.11) so I think 2.6.30.y deserves another
stable update to fix this critical issue.

Regards,

Ozan Caglayan
Pardus Linux -- http://www.pardus.org.tr/eng

2010-01-13 21:17:54

by Ozan Çağlayan

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

Ozan Çağlayan wrote:

> This causes kernel panic upon boot on one of our users' ext3 system (on 2.6.31.11) so I think 2.6.30.y deserves another
> stable update to fix this critical issue.

oops, 2.6.30.y should be 2.6.31.y, sorry.

2010-01-13 21:50:00

by Greg KH

[permalink] [raw]
Subject: Re: Linux 2.6.31.10

On Wed, Jan 13, 2010 at 11:17:47PM +0200, Ozan Çağlayan wrote:
> Ozan Çağlayan wrote:
>
> > This causes kernel panic upon boot on one of our users' ext3 system (on 2.6.31.11) so I think 2.6.30.y deserves another
> > stable update to fix this critical issue.
>
> oops, 2.6.30.y should be 2.6.31.y, sorry.

Yes, .31 will be getting another release with this fix in it, sorry for
the delay, been stuck debugging other things these past few days...

thanks,

greg k-h