History

hpfs: fix warnings when the filesystem fills up

This patch fixes warnings due to missing lock on write error path. WARNING: at fs/hpfs/hpfs_fn.h:353 hpfs_truncate+0x75/0x80 [hpfs]() Hardware name: empty Pid: 26563, comm: dd Tainted: P O 3.9.4 #12 Call Trace: hpfs_truncate+0x75/0x80 [hpfs] hpfs_write_begin+0x84/0x90 [hpfs] _hpfs_bmap+0x10/0x10 [hpfs] generic_file_buffered_write+0x121/0x2c0 __generic_file_aio_write+0x1c7/0x3f0 generic_file_aio_write+0x7c/0x100 do_sync_write+0x98/0xd0 hpfs_file_write+0xd/0x50 [hpfs] vfs_write+0xa2/0x160 sys_write+0x51/0xa0 page_fault+0x22/0x30 system_call_fastpath+0x1a/0x1f

Mikulas Patocka committed 13 years ago

Commit bbd465d1 parent 81db4db1 file · +4 −0Browse files

Unified · Split

fs/hpfs/file.c+4−0
@@ -109,10 +109,14 @@ static void hpfs_write_failed(struct address_space *mapping, loff_t to) · 108 unmodified lines
109109 {
110110 struct inode *inode = mapping->host;
111111
112+ hpfs_lock(inode->i_sb);
113+
112114 if (to > inode->i_size) {
113115 truncate_pagecache(inode, to, inode->i_size);
114116 hpfs_truncate(inode);
115117 }
118+
119+ hpfs_unlock(inode->i_sb);
116120 }
117121
118122 static int hpfs_write_begin(struct file *file, struct address_space *mapping,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t