projects
/
unionfs-2.6.39.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94a92d5
)
ocfs2: ocfs2_write_begin_nolock() should handle len=0
author
Sunil Mushran
<sunil.mushran@oracle.com>
Fri, 4 Sep 2009 18:12:01 +0000
(11:12 -0700)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Wed, 9 Sep 2009 03:34:12 +0000
(20:34 -0700)
commit
8379e7c46cc48f51197dd663fc6676f47f2a1e71
upstream.
Bug introduced by mainline commit
e7432675f8ca868a4af365759a8d4c3779a3d922
The bug causes ocfs2_write_begin_nolock() to oops when len=0.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ocfs2/aops.c
patch
|
blob
|
history
diff --git
a/fs/ocfs2/aops.c
b/fs/ocfs2/aops.c
index 122fb7978f60f7dde54ac0567f578159900f163b..044990a47855aba90937509270fcebfb624bcbcd 100644
(file)
--- a/
fs/ocfs2/aops.c
+++ b/
fs/ocfs2/aops.c
@@
-1746,8
+1746,8
@@
int ocfs2_write_begin_nolock(struct address_space *mapping,
* we know zeros will only be needed in the first and/or last cluster.
*/
if (clusters_to_alloc || extents_to_split ||
- wc->w_desc[0].c_needs_zero ||
-
wc->w_desc[wc->w_clen - 1].c_needs_zero
)
+
(wc->w_clen && (
wc->w_desc[0].c_needs_zero ||
+
wc->w_desc[wc->w_clen - 1].c_needs_zero))
)
cluster_of_pages = 1;
else
cluster_of_pages = 0;