[PATCH] hpfs: fix warnings when the filesystem fills up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hpfs: fix warnings when the filesystem fills up

This patch fixes warnings due to missing lock on write error path.

[11624.793312] ------------[ cut here ]------------
[11624.795305] WARNING: at fs/hpfs/hpfs_fn.h:353 hpfs_truncate+0x75/0x80 [hpfs]()
[11624.797483] Hardware name: empty
[11624.797547] Pid: 26563, comm: dd Tainted: P           O 3.9.4 #12
[11624.797548] Call Trace:
[11624.797556]  [<ffffffff81035ed9>] ? warn_slowpath_common+0x79/0xc0
[11624.797559]  [<ffffffffa0033775>] ? hpfs_truncate+0x75/0x80 [hpfs]
[11624.797561]  [<ffffffffa0033804>] ? hpfs_write_begin+0x84/0x90 [hpfs]
[11624.797563]  [<ffffffffa0033490>] ? _hpfs_bmap+0x10/0x10 [hpfs]
[11624.797568]  [<ffffffff810c0771>] ? generic_file_buffered_write+0x121/0x2c0
[11624.797570]  [<ffffffff810c18e7>] ? __generic_file_aio_write+0x1c7/0x3f0
[11624.797572]  [<ffffffff810c1b8c>] ? generic_file_aio_write+0x7c/0x100
[11624.797576]  [<ffffffff81115f38>] ? do_sync_write+0x98/0xd0
[11624.797579]  [<ffffffffa00336bd>] ? hpfs_file_write+0xd/0x50 [hpfs]
[11624.797581]  [<ffffffff81116522>] ? vfs_write+0xa2/0x160
[11624.797582]  [<ffffffff81116801>] ? sys_write+0x51/0xa0
[11624.797586]  [<ffffffff813515e2>] ? page_fault+0x22/0x30
[11624.797588]  [<ffffffff81351b16>] ? system_call_fastpath+0x1a/0x1f
[11624.797589] ---[ end trace 073c81ffe88d3716 ]---

This should be backported to stable kernels 2.6.39 and newer.

Signed-off-by: Mikulas Patocka <mikulas@xxxxxxxxxxxxxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxx

---
 fs/hpfs/file.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-3.9.4-fast/fs/hpfs/file.c
===================================================================
--- linux-3.9.4-fast.orig/fs/hpfs/file.c	2013-06-07 03:01:45.000000000 +0200
+++ linux-3.9.4-fast/fs/hpfs/file.c	2013-06-07 03:02:44.000000000 +0200
@@ -109,10 +109,14 @@ static void hpfs_write_failed(struct add
 {
 	struct inode *inode = mapping->host;
 
+	hpfs_lock(inode->i_sb);
+
 	if (to > inode->i_size) {
 		truncate_pagecache(inode, to, inode->i_size);
 		hpfs_truncate(inode);
 	}
+
+	hpfs_unlock(inode->i_sb);
 }
 
 static int hpfs_write_begin(struct file *file, struct address_space *mapping,
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux