aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-07 00:14:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-07 00:14:42 -0400
commit33caee39925b887a99a2400dc5c980097c3573f9 (patch)
tree8e68ad97e1fee88c4a3f31453041f8d139f2027e /fs
parent6456a0438b984186a0c9c8ecc9fe3d97b7ac3613 (diff)
parentf84223087402c45179be5e7060c5736c17a7b271 (diff)
Merge branch 'akpm' (patchbomb from Andrew Morton)
Merge incoming from Andrew Morton: - Various misc things. - arch/sh updates. - Part of ocfs2. Review is slow. - Slab updates. - Most of -mm. - printk updates. - lib/ updates. - checkpatch updates. * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (226 commits) checkpatch: update $declaration_macros, add uninitialized_var checkpatch: warn on missing spaces in broken up quoted checkpatch: fix false positives for --strict "space after cast" test checkpatch: fix false positive MISSING_BREAK warnings with --file checkpatch: add test for native c90 types in unusual order checkpatch: add signed generic types checkpatch: add short int to c variable types checkpatch: add for_each tests to indentation and brace tests checkpatch: fix brace style misuses of else and while checkpatch: add --fix option for a couple OPEN_BRACE misuses checkpatch: use the correct indentation for which() checkpatch: add fix_insert_line and fix_delete_line helpers checkpatch: add ability to insert and delete lines to patch/file checkpatch: add an index variable for fixed lines checkpatch: warn on break after goto or return with same tab indentation checkpatch: emit a warning on file add/move/delete checkpatch: add test for commit id formatting style in commit log checkpatch: emit fewer kmalloc_array/kcalloc conversion warnings checkpatch: improve "no space after cast" test checkpatch: allow multiple const * types ...
Diffstat (limited to 'fs')
-rw-r--r--fs/fscache/main.c4
-rw-r--r--fs/logfs/readwrite.c15
-rw-r--r--fs/namespace.c2
-rw-r--r--fs/notify/fanotify/fanotify.c11
-rw-r--r--fs/notify/fanotify/fanotify_user.c14
-rw-r--r--fs/notify/inode_mark.c2
-rw-r--r--fs/notify/inotify/inotify_fsnotify.c2
-rw-r--r--fs/notify/inotify/inotify_user.c4
-rw-r--r--fs/notify/notification.c37
-rw-r--r--fs/notify/vfsmount_mark.c2
-rw-r--r--fs/ntfs/file.c3
-rw-r--r--fs/ocfs2/alloc.c15
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c5
-rw-r--r--fs/ocfs2/dlm/dlmmaster.c4
-rw-r--r--fs/ocfs2/move_extents.c2
-rw-r--r--fs/ocfs2/refcounttree.c2
-rw-r--r--fs/ocfs2/slot_map.c2
-rw-r--r--fs/proc/meminfo.c2
-rw-r--r--fs/proc/task_mmu.c27
-rw-r--r--fs/squashfs/file_direct.c2
-rw-r--r--fs/squashfs/super.c5
21 files changed, 111 insertions, 51 deletions
diff --git a/fs/fscache/main.c b/fs/fscache/main.c
index a31b83c5cbd9..b39d487ccfb0 100644
--- a/fs/fscache/main.c
+++ b/fs/fscache/main.c
@@ -67,7 +67,7 @@ static int fscache_max_active_sysctl(struct ctl_table *table, int write,
67 return ret; 67 return ret;
68} 68}
69 69
70struct ctl_table fscache_sysctls[] = { 70static struct ctl_table fscache_sysctls[] = {
71 { 71 {
72 .procname = "object_max_active", 72 .procname = "object_max_active",
73 .data = &fscache_object_max_active, 73 .data = &fscache_object_max_active,
@@ -87,7 +87,7 @@ struct ctl_table fscache_sysctls[] = {
87 {} 87 {}
88}; 88};
89 89
90struct ctl_table fscache_sysctls_root[] = { 90static struct ctl_table fscache_sysctls_root[] = {
91 { 91 {
92 .procname = "fscache", 92 .procname = "fscache",
93 .mode = 0555, 93 .mode = 0555,
diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c
index 48140315f627..380d86e1ab45 100644
--- a/fs/logfs/readwrite.c
+++ b/fs/logfs/readwrite.c
@@ -1019,11 +1019,11 @@ static int __logfs_is_valid_block(struct inode *inode, u64 bix, u64 ofs)
1019/** 1019/**
1020 * logfs_is_valid_block - check whether this block is still valid 1020 * logfs_is_valid_block - check whether this block is still valid
1021 * 1021 *
1022 * @sb - superblock 1022 * @sb: superblock
1023 * @ofs - block physical offset 1023 * @ofs: block physical offset
1024 * @ino - block inode number 1024 * @ino: block inode number
1025 * @bix - block index 1025 * @bix: block index
1026 * @level - block level 1026 * @gc_level: block level
1027 * 1027 *
1028 * Returns 0 if the block is invalid, 1 if it is valid and 2 if it will 1028 * Returns 0 if the block is invalid, 1 if it is valid and 2 if it will
1029 * become invalid once the journal is written. 1029 * become invalid once the journal is written.
@@ -2226,10 +2226,9 @@ void btree_write_block(struct logfs_block *block)
2226 * 2226 *
2227 * @inode: parent inode (ifile or directory) 2227 * @inode: parent inode (ifile or directory)
2228 * @buf: object to write (inode or dentry) 2228 * @buf: object to write (inode or dentry)
2229 * @n: object size 2229 * @count: object size
2230 * @_pos: object number (file position in blocks/objects) 2230 * @bix: block index
2231 * @flags: write flags 2231 * @flags: write flags
2232 * @lock: 0 if write lock is already taken, 1 otherwise
2233 * @shadow_tree: shadow below this inode 2232 * @shadow_tree: shadow below this inode
2234 * 2233 *
2235 * FIXME: All caller of this put a 200-300 byte variable on the stack, 2234 * FIXME: All caller of this put a 200-300 byte variable on the stack,
diff --git a/fs/namespace.c b/fs/namespace.c
index 182bc41cd887..2a1447c946e7 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -798,7 +798,7 @@ static void commit_tree(struct mount *mnt, struct mount *shadows)
798 list_splice(&head, n->list.prev); 798 list_splice(&head, n->list.prev);
799 799
800 if (shadows) 800 if (shadows)
801 hlist_add_after_rcu(&shadows->mnt_hash, &mnt->mnt_hash); 801 hlist_add_behind_rcu(&mnt->mnt_hash, &shadows->mnt_hash);
802 else 802 else
803 hlist_add_head_rcu(&mnt->mnt_hash, 803 hlist_add_head_rcu(&mnt->mnt_hash,
804 m_hash(&parent->mnt, mnt->mnt_mountpoint)); 804 m_hash(&parent->mnt, mnt->mnt_mountpoint));
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index ee9cb3795c2b..30d3addfad75 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -70,8 +70,15 @@ static int fanotify_get_response(struct fsnotify_group *group,
70 wait_event(group->fanotify_data.access_waitq, event->response || 70 wait_event(group->fanotify_data.access_waitq, event->response ||
71 atomic_read(&group->fanotify_data.bypass_perm)); 71 atomic_read(&group->fanotify_data.bypass_perm));
72 72
73 if (!event->response) /* bypass_perm set */ 73 if (!event->response) { /* bypass_perm set */
74 /*
75 * Event was canceled because group is being destroyed. Remove
76 * it from group's event list because we are responsible for
77 * freeing the permission event.
78 */
79 fsnotify_remove_event(group, &event->fae.fse);
74 return 0; 80 return 0;
81 }
75 82
76 /* userspace responded, convert to something usable */ 83 /* userspace responded, convert to something usable */
77 switch (event->response) { 84 switch (event->response) {
@@ -210,7 +217,7 @@ static int fanotify_handle_event(struct fsnotify_group *group,
210 return -ENOMEM; 217 return -ENOMEM;
211 218
212 fsn_event = &event->fse; 219 fsn_event = &event->fse;
213 ret = fsnotify_add_notify_event(group, fsn_event, fanotify_merge); 220 ret = fsnotify_add_event(group, fsn_event, fanotify_merge);
214 if (ret) { 221 if (ret) {
215 /* Permission events shouldn't be merged */ 222 /* Permission events shouldn't be merged */
216 BUG_ON(ret == 1 && mask & FAN_ALL_PERM_EVENTS); 223 BUG_ON(ret == 1 && mask & FAN_ALL_PERM_EVENTS);
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 3fdc8a3e1134..b13992a41bd9 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -66,7 +66,7 @@ static struct fsnotify_event *get_one_event(struct fsnotify_group *group,
66 66
67 /* held the notification_mutex the whole time, so this is the 67 /* held the notification_mutex the whole time, so this is the
68 * same event we peeked above */ 68 * same event we peeked above */
69 return fsnotify_remove_notify_event(group); 69 return fsnotify_remove_first_event(group);
70} 70}
71 71
72static int create_fd(struct fsnotify_group *group, 72static int create_fd(struct fsnotify_group *group,
@@ -359,6 +359,11 @@ static int fanotify_release(struct inode *ignored, struct file *file)
359#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS 359#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
360 struct fanotify_perm_event_info *event, *next; 360 struct fanotify_perm_event_info *event, *next;
361 361
362 /*
363 * There may be still new events arriving in the notification queue
364 * but since userspace cannot use fanotify fd anymore, no event can
365 * enter or leave access_list by now.
366 */
362 spin_lock(&group->fanotify_data.access_lock); 367 spin_lock(&group->fanotify_data.access_lock);
363 368
364 atomic_inc(&group->fanotify_data.bypass_perm); 369 atomic_inc(&group->fanotify_data.bypass_perm);
@@ -373,6 +378,13 @@ static int fanotify_release(struct inode *ignored, struct file *file)
373 } 378 }
374 spin_unlock(&group->fanotify_data.access_lock); 379 spin_unlock(&group->fanotify_data.access_lock);
375 380
381 /*
382 * Since bypass_perm is set, newly queued events will not wait for
383 * access response. Wake up the already sleeping ones now.
384 * synchronize_srcu() in fsnotify_destroy_group() will wait for all
385 * processes sleeping in fanotify_handle_event() waiting for access
386 * response and thus also for all permission events to be freed.
387 */
376 wake_up(&group->fanotify_data.access_waitq); 388 wake_up(&group->fanotify_data.access_waitq);
377#endif 389#endif
378 390
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
index 74825be65b7b..9ce062218de9 100644
--- a/fs/notify/inode_mark.c
+++ b/fs/notify/inode_mark.c
@@ -232,7 +232,7 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
232 232
233 BUG_ON(last == NULL); 233 BUG_ON(last == NULL);
234 /* mark should be the last entry. last is the current last entry */ 234 /* mark should be the last entry. last is the current last entry */
235 hlist_add_after_rcu(&last->i.i_list, &mark->i.i_list); 235 hlist_add_behind_rcu(&mark->i.i_list, &last->i.i_list);
236out: 236out:
237 fsnotify_recalc_inode_mask_locked(inode); 237 fsnotify_recalc_inode_mask_locked(inode);
238 spin_unlock(&inode->i_lock); 238 spin_unlock(&inode->i_lock);
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
index 43ab1e1a07a2..0f88bc0b4e6c 100644
--- a/fs/notify/inotify/inotify_fsnotify.c
+++ b/fs/notify/inotify/inotify_fsnotify.c
@@ -108,7 +108,7 @@ int inotify_handle_event(struct fsnotify_group *group,
108 if (len) 108 if (len)
109 strcpy(event->name, file_name); 109 strcpy(event->name, file_name);
110 110
111 ret = fsnotify_add_notify_event(group, fsn_event, inotify_merge); 111 ret = fsnotify_add_event(group, fsn_event, inotify_merge);
112 if (ret) { 112 if (ret) {
113 /* Our event wasn't used in the end. Free it. */ 113 /* Our event wasn't used in the end. Free it. */
114 fsnotify_destroy_event(group, fsn_event); 114 fsnotify_destroy_event(group, fsn_event);
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index cc423a30a0c8..daf76652fe58 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -149,7 +149,7 @@ static struct fsnotify_event *get_one_event(struct fsnotify_group *group,
149 if (fsnotify_notify_queue_is_empty(group)) 149 if (fsnotify_notify_queue_is_empty(group))
150 return NULL; 150 return NULL;
151 151
152 event = fsnotify_peek_notify_event(group); 152 event = fsnotify_peek_first_event(group);
153 153
154 pr_debug("%s: group=%p event=%p\n", __func__, group, event); 154 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
155 155
@@ -159,7 +159,7 @@ static struct fsnotify_event *get_one_event(struct fsnotify_group *group,
159 159
160 /* held the notification_mutex the whole time, so this is the 160 /* held the notification_mutex the whole time, so this is the
161 * same event we peeked above */ 161 * same event we peeked above */
162 fsnotify_remove_notify_event(group); 162 fsnotify_remove_first_event(group);
163 163
164 return event; 164 return event;
165} 165}
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
index 1e58402171a5..a95d8e037aeb 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -73,7 +73,8 @@ void fsnotify_destroy_event(struct fsnotify_group *group,
73 /* Overflow events are per-group and we don't want to free them */ 73 /* Overflow events are per-group and we don't want to free them */
74 if (!event || event->mask == FS_Q_OVERFLOW) 74 if (!event || event->mask == FS_Q_OVERFLOW)
75 return; 75 return;
76 76 /* If the event is still queued, we have a problem... */
77 WARN_ON(!list_empty(&event->list));
77 group->ops->free_event(event); 78 group->ops->free_event(event);
78} 79}
79 80
@@ -83,10 +84,10 @@ void fsnotify_destroy_event(struct fsnotify_group *group,
83 * added to the queue, 1 if the event was merged with some other queued event, 84 * added to the queue, 1 if the event was merged with some other queued event,
84 * 2 if the queue of events has overflown. 85 * 2 if the queue of events has overflown.
85 */ 86 */
86int fsnotify_add_notify_event(struct fsnotify_group *group, 87int fsnotify_add_event(struct fsnotify_group *group,
87 struct fsnotify_event *event, 88 struct fsnotify_event *event,
88 int (*merge)(struct list_head *, 89 int (*merge)(struct list_head *,
89 struct fsnotify_event *)) 90 struct fsnotify_event *))
90{ 91{
91 int ret = 0; 92 int ret = 0;
92 struct list_head *list = &group->notification_list; 93 struct list_head *list = &group->notification_list;
@@ -125,10 +126,25 @@ queue:
125} 126}
126 127
127/* 128/*
129 * Remove @event from group's notification queue. It is the responsibility of
130 * the caller to destroy the event.
131 */
132void fsnotify_remove_event(struct fsnotify_group *group,
133 struct fsnotify_event *event)
134{
135 mutex_lock(&group->notification_mutex);
136 if (!list_empty(&event->list)) {
137 list_del_init(&event->list);
138 group->q_len--;
139 }
140 mutex_unlock(&group->notification_mutex);
141}
142
143/*
128 * Remove and return the first event from the notification list. It is the 144 * Remove and return the first event from the notification list. It is the
129 * responsibility of the caller to destroy the obtained event 145 * responsibility of the caller to destroy the obtained event
130 */ 146 */
131struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group) 147struct fsnotify_event *fsnotify_remove_first_event(struct fsnotify_group *group)
132{ 148{
133 struct fsnotify_event *event; 149 struct fsnotify_event *event;
134 150
@@ -140,7 +156,7 @@ struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group
140 struct fsnotify_event, list); 156 struct fsnotify_event, list);
141 /* 157 /*
142 * We need to init list head for the case of overflow event so that 158 * We need to init list head for the case of overflow event so that
143 * check in fsnotify_add_notify_events() works 159 * check in fsnotify_add_event() works
144 */ 160 */
145 list_del_init(&event->list); 161 list_del_init(&event->list);
146 group->q_len--; 162 group->q_len--;
@@ -149,9 +165,10 @@ struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group
149} 165}
150 166
151/* 167/*
152 * This will not remove the event, that must be done with fsnotify_remove_notify_event() 168 * This will not remove the event, that must be done with
169 * fsnotify_remove_first_event()
153 */ 170 */
154struct fsnotify_event *fsnotify_peek_notify_event(struct fsnotify_group *group) 171struct fsnotify_event *fsnotify_peek_first_event(struct fsnotify_group *group)
155{ 172{
156 BUG_ON(!mutex_is_locked(&group->notification_mutex)); 173 BUG_ON(!mutex_is_locked(&group->notification_mutex));
157 174
@@ -169,7 +186,7 @@ void fsnotify_flush_notify(struct fsnotify_group *group)
169 186
170 mutex_lock(&group->notification_mutex); 187 mutex_lock(&group->notification_mutex);
171 while (!fsnotify_notify_queue_is_empty(group)) { 188 while (!fsnotify_notify_queue_is_empty(group)) {
172 event = fsnotify_remove_notify_event(group); 189 event = fsnotify_remove_first_event(group);
173 fsnotify_destroy_event(group, event); 190 fsnotify_destroy_event(group, event);
174 } 191 }
175 mutex_unlock(&group->notification_mutex); 192 mutex_unlock(&group->notification_mutex);
diff --git a/fs/notify/vfsmount_mark.c b/fs/notify/vfsmount_mark.c
index 68ca5a8704b5..ac851e8376b1 100644
--- a/fs/notify/vfsmount_mark.c
+++ b/fs/notify/vfsmount_mark.c
@@ -191,7 +191,7 @@ int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark,
191 191
192 BUG_ON(last == NULL); 192 BUG_ON(last == NULL);
193 /* mark should be the last entry. last is the current last entry */ 193 /* mark should be the last entry. last is the current last entry */
194 hlist_add_after_rcu(&last->m.m_list, &mark->m.m_list); 194 hlist_add_behind_rcu(&mark->m.m_list, &last->m.m_list);
195out: 195out:
196 fsnotify_recalc_vfsmount_mask_locked(mnt); 196 fsnotify_recalc_vfsmount_mask_locked(mnt);
197 spin_unlock(&mnt->mnt_root->d_lock); 197 spin_unlock(&mnt->mnt_root->d_lock);
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 5c9e2c81cb11..f5ec1ce7a532 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -74,8 +74,6 @@ static int ntfs_file_open(struct inode *vi, struct file *filp)
74 * ntfs_attr_extend_initialized - extend the initialized size of an attribute 74 * ntfs_attr_extend_initialized - extend the initialized size of an attribute
75 * @ni: ntfs inode of the attribute to extend 75 * @ni: ntfs inode of the attribute to extend
76 * @new_init_size: requested new initialized size in bytes 76 * @new_init_size: requested new initialized size in bytes
77 * @cached_page: store any allocated but unused page here
78 * @lru_pvec: lru-buffering pagevec of the caller
79 * 77 *
80 * Extend the initialized size of an attribute described by the ntfs inode @ni 78 * Extend the initialized size of an attribute described by the ntfs inode @ni
81 * to @new_init_size bytes. This involves zeroing any non-sparse space between 79 * to @new_init_size bytes. This involves zeroing any non-sparse space between
@@ -395,7 +393,6 @@ static inline void ntfs_fault_in_pages_readable_iovec(const struct iovec *iov,
395 * @nr_pages: number of page cache pages to obtain 393 * @nr_pages: number of page cache pages to obtain
396 * @pages: array of pages in which to return the obtained page cache pages 394 * @pages: array of pages in which to return the obtained page cache pages
397 * @cached_page: allocated but as yet unused page 395 * @cached_page: allocated but as yet unused page
398 * @lru_pvec: lru-buffering pagevec of caller
399 * 396 *
400 * Obtain @nr_pages locked page cache pages from the mapping @mapping and 397 * Obtain @nr_pages locked page cache pages from the mapping @mapping and
401 * starting at index @index. 398 * starting at index @index.
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 9d8fcf2f3b94..a93bf9892256 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -4961,6 +4961,15 @@ leftright:
4961 4961
4962 el = path_leaf_el(path); 4962 el = path_leaf_el(path);
4963 split_index = ocfs2_search_extent_list(el, cpos); 4963 split_index = ocfs2_search_extent_list(el, cpos);
4964 if (split_index == -1) {
4965 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
4966 "Owner %llu has an extent at cpos %u "
4967 "which can no longer be found.\n",
4968 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
4969 cpos);
4970 ret = -EROFS;
4971 goto out;
4972 }
4964 goto leftright; 4973 goto leftright;
4965 } 4974 }
4966out: 4975out:
@@ -5135,7 +5144,7 @@ int ocfs2_change_extent_flag(handle_t *handle,
5135 el = path_leaf_el(left_path); 5144 el = path_leaf_el(left_path);
5136 5145
5137 index = ocfs2_search_extent_list(el, cpos); 5146 index = ocfs2_search_extent_list(el, cpos);
5138 if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) { 5147 if (index == -1) {
5139 ocfs2_error(sb, 5148 ocfs2_error(sb,
5140 "Owner %llu has an extent at cpos %u which can no " 5149 "Owner %llu has an extent at cpos %u which can no "
5141 "longer be found.\n", 5150 "longer be found.\n",
@@ -5491,7 +5500,7 @@ int ocfs2_remove_extent(handle_t *handle,
5491 5500
5492 el = path_leaf_el(path); 5501 el = path_leaf_el(path);
5493 index = ocfs2_search_extent_list(el, cpos); 5502 index = ocfs2_search_extent_list(el, cpos);
5494 if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) { 5503 if (index == -1) {
5495 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), 5504 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
5496 "Owner %llu has an extent at cpos %u which can no " 5505 "Owner %llu has an extent at cpos %u which can no "
5497 "longer be found.\n", 5506 "longer be found.\n",
@@ -5557,7 +5566,7 @@ int ocfs2_remove_extent(handle_t *handle,
5557 5566
5558 el = path_leaf_el(path); 5567 el = path_leaf_el(path);
5559 index = ocfs2_search_extent_list(el, cpos); 5568 index = ocfs2_search_extent_list(el, cpos);
5560 if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) { 5569 if (index == -1) {
5561 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), 5570 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
5562 "Owner %llu: split at cpos %u lost record.", 5571 "Owner %llu: split at cpos %u lost record.",
5563 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), 5572 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 39efc5057a36..3fcf205ee900 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -1923,12 +1923,11 @@ static int dlm_join_domain(struct dlm_ctxt *dlm)
1923 goto bail; 1923 goto bail;
1924 } 1924 }
1925 1925
1926 if (total_backoff > 1926 if (total_backoff > DLM_JOIN_TIMEOUT_MSECS) {
1927 msecs_to_jiffies(DLM_JOIN_TIMEOUT_MSECS)) {
1928 status = -ERESTARTSYS; 1927 status = -ERESTARTSYS;
1929 mlog(ML_NOTICE, "Timed out joining dlm domain " 1928 mlog(ML_NOTICE, "Timed out joining dlm domain "
1930 "%s after %u msecs\n", dlm->name, 1929 "%s after %u msecs\n", dlm->name,
1931 jiffies_to_msecs(total_backoff)); 1930 total_backoff);
1932 goto bail; 1931 goto bail;
1933 } 1932 }
1934 1933
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 82abf0cc9a12..3ec906ef5d9a 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -2405,6 +2405,10 @@ static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,
2405 if (res->state & DLM_LOCK_RES_MIGRATING) 2405 if (res->state & DLM_LOCK_RES_MIGRATING)
2406 return 0; 2406 return 0;
2407 2407
2408 /* delay migration when the lockres is in RECOCERING state */
2409 if (res->state & DLM_LOCK_RES_RECOVERING)
2410 return 0;
2411
2408 if (res->owner != dlm->node_num) 2412 if (res->owner != dlm->node_num)
2409 return 0; 2413 return 0;
2410 2414
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c
index 599eb4c4c8be..6219aaadeb08 100644
--- a/fs/ocfs2/move_extents.c
+++ b/fs/ocfs2/move_extents.c
@@ -98,7 +98,7 @@ static int __ocfs2_move_extent(handle_t *handle,
98 el = path_leaf_el(path); 98 el = path_leaf_el(path);
99 99
100 index = ocfs2_search_extent_list(el, cpos); 100 index = ocfs2_search_extent_list(el, cpos);
101 if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) { 101 if (index == -1) {
102 ocfs2_error(inode->i_sb, 102 ocfs2_error(inode->i_sb,
103 "Inode %llu has an extent at cpos %u which can no " 103 "Inode %llu has an extent at cpos %u which can no "
104 "longer be found.\n", 104 "longer be found.\n",
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 636aab69ead5..d81f6e2a97f5 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -3109,7 +3109,7 @@ static int ocfs2_clear_ext_refcount(handle_t *handle,
3109 el = path_leaf_el(path); 3109 el = path_leaf_el(path);
3110 3110
3111 index = ocfs2_search_extent_list(el, cpos); 3111 index = ocfs2_search_extent_list(el, cpos);
3112 if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) { 3112 if (index == -1) {
3113 ocfs2_error(sb, 3113 ocfs2_error(sb,
3114 "Inode %llu has an extent at cpos %u which can no " 3114 "Inode %llu has an extent at cpos %u which can no "
3115 "longer be found.\n", 3115 "longer be found.\n",
diff --git a/fs/ocfs2/slot_map.c b/fs/ocfs2/slot_map.c
index 1424c151cccc..a88b2a4fcc85 100644
--- a/fs/ocfs2/slot_map.c
+++ b/fs/ocfs2/slot_map.c
@@ -382,7 +382,7 @@ static int ocfs2_map_slot_buffers(struct ocfs2_super *osb,
382 382
383 trace_ocfs2_map_slot_buffers(bytes, si->si_blocks); 383 trace_ocfs2_map_slot_buffers(bytes, si->si_blocks);
384 384
385 si->si_bh = kzalloc(sizeof(struct buffer_head *) * si->si_blocks, 385 si->si_bh = kcalloc(si->si_blocks, sizeof(struct buffer_head *),
386 GFP_KERNEL); 386 GFP_KERNEL);
387 if (!si->si_bh) { 387 if (!si->si_bh) {
388 status = -ENOMEM; 388 status = -ENOMEM;
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 7445af0b1aa3..aa1eee06420f 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -168,7 +168,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
168 K(global_page_state(NR_WRITEBACK)), 168 K(global_page_state(NR_WRITEBACK)),
169 K(global_page_state(NR_ANON_PAGES)), 169 K(global_page_state(NR_ANON_PAGES)),
170 K(global_page_state(NR_FILE_MAPPED)), 170 K(global_page_state(NR_FILE_MAPPED)),
171 K(global_page_state(NR_SHMEM)), 171 K(i.sharedram),
172 K(global_page_state(NR_SLAB_RECLAIMABLE) + 172 K(global_page_state(NR_SLAB_RECLAIMABLE) +
173 global_page_state(NR_SLAB_UNRECLAIMABLE)), 173 global_page_state(NR_SLAB_UNRECLAIMABLE)),
174 K(global_page_state(NR_SLAB_RECLAIMABLE)), 174 K(global_page_state(NR_SLAB_RECLAIMABLE)),
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index cfa63ee92c96..dfc791c42d64 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -925,15 +925,30 @@ static int pagemap_pte_hole(unsigned long start, unsigned long end,
925 struct mm_walk *walk) 925 struct mm_walk *walk)
926{ 926{
927 struct pagemapread *pm = walk->private; 927 struct pagemapread *pm = walk->private;
928 unsigned long addr; 928 unsigned long addr = start;
929 int err = 0; 929 int err = 0;
930 pagemap_entry_t pme = make_pme(PM_NOT_PRESENT(pm->v2));
931 930
932 for (addr = start; addr < end; addr += PAGE_SIZE) { 931 while (addr < end) {
933 err = add_to_pagemap(addr, &pme, pm); 932 struct vm_area_struct *vma = find_vma(walk->mm, addr);
934 if (err) 933 pagemap_entry_t pme = make_pme(PM_NOT_PRESENT(pm->v2));
935 break; 934 unsigned long vm_end;
935
936 if (!vma) {
937 vm_end = end;
938 } else {
939 vm_end = min(end, vma->vm_end);
940 if (vma->vm_flags & VM_SOFTDIRTY)
941 pme.pme |= PM_STATUS2(pm->v2, __PM_SOFT_DIRTY);
942 }
943
944 for (; addr < vm_end; addr += PAGE_SIZE) {
945 err = add_to_pagemap(addr, &pme, pm);
946 if (err)
947 goto out;
948 }
936 } 949 }
950
951out:
937 return err; 952 return err;
938} 953}
939 954
diff --git a/fs/squashfs/file_direct.c b/fs/squashfs/file_direct.c
index 62a0de6632e1..43e7a7eddac0 100644
--- a/fs/squashfs/file_direct.c
+++ b/fs/squashfs/file_direct.c
@@ -44,7 +44,7 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize)
44 44
45 pages = end_index - start_index + 1; 45 pages = end_index - start_index + 1;
46 46
47 page = kmalloc(sizeof(void *) * pages, GFP_KERNEL); 47 page = kmalloc_array(pages, sizeof(void *), GFP_KERNEL);
48 if (page == NULL) 48 if (page == NULL)
49 return res; 49 return res;
50 50
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index 031c8d67fd51..5056babe00df 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -27,6 +27,8 @@
27 * the filesystem. 27 * the filesystem.
28 */ 28 */
29 29
30#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31
30#include <linux/fs.h> 32#include <linux/fs.h>
31#include <linux/vfs.h> 33#include <linux/vfs.h>
32#include <linux/slab.h> 34#include <linux/slab.h>
@@ -448,8 +450,7 @@ static int __init init_squashfs_fs(void)
448 return err; 450 return err;
449 } 451 }
450 452
451 printk(KERN_INFO "squashfs: version 4.0 (2009/01/31) " 453 pr_info("version 4.0 (2009/01/31) Phillip Lougher\n");
452 "Phillip Lougher\n");
453 454
454 return 0; 455 return 0;
455} 456}