aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorVladimir Saveliev <vs@namesys.com>2007-01-22 23:40:46 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-23 10:52:06 -0500
commitde14569f94513279e3d44d9571a421e9da1759ae (patch)
tree9cc06497397728a13cc53150c574fd6d9896b7c5 /include/linux
parent30150f8d7b76f25b1127a5079528b7a17307f995 (diff)
[PATCH] resierfs: avoid tail packing if an inode was ever mmapped
This patch fixes a confusion reiserfs has for a long time. On release file operation reiserfs used to try to pack file data stored in last incomplete page of some files into metadata blocks. After packing the page got cleared with clear_page_dirty. It did not take into account that the page may be mmaped into other process's address space. Recent replacement for clear_page_dirty cancel_dirty_page found the confusion with sanity check that page has to be not mapped. The patch fixes the confusion by making reiserfs avoid tail packing if an inode was ever mmapped. reiserfs_mmap and reiserfs_file_release are serialized with mutex in reiserfs specific inode. reiserfs_mmap locks the mutex and sets a bit in reiserfs specific inode flags. reiserfs_file_release checks the bit having the mutex locked. If bit is set - tail packing is avoided. This eliminates a possibility that mmapped page gets cancel_page_dirty-ed. Signed-off-by: Vladimir Saveliev <vs@namesys.com> Cc: Jeff Mahoney <jeffm@suse.com> Cc: Chris Mason <mason@suse.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/reiserfs_fs_i.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index 5b3b297aa2c5..ce3663fb0101 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -25,6 +25,7 @@ typedef enum {
25 i_link_saved_truncate_mask = 0x0020, 25 i_link_saved_truncate_mask = 0x0020,
26 i_has_xattr_dir = 0x0040, 26 i_has_xattr_dir = 0x0040,
27 i_data_log = 0x0080, 27 i_data_log = 0x0080,
28 i_ever_mapped = 0x0100
28} reiserfs_inode_flags; 29} reiserfs_inode_flags;
29 30
30struct reiserfs_inode_info { 31struct reiserfs_inode_info {
@@ -52,6 +53,7 @@ struct reiserfs_inode_info {
52 ** flushed */ 53 ** flushed */
53 unsigned long i_trans_id; 54 unsigned long i_trans_id;
54 struct reiserfs_journal_list *i_jl; 55 struct reiserfs_journal_list *i_jl;
56 struct mutex i_mmap;
55#ifdef CONFIG_REISERFS_FS_POSIX_ACL 57#ifdef CONFIG_REISERFS_FS_POSIX_ACL
56 struct posix_acl *i_acl_access; 58 struct posix_acl *i_acl_access;
57 struct posix_acl *i_acl_default; 59 struct posix_acl *i_acl_default;