* [Ocfs2-devel] [bug report] ocfs2: fix sparse file & data ordering issue in direct io
@ 2016-07-07 15:35 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-07-07 15:35 UTC (permalink / raw)
To: ocfs2-devel
Hello Ryan Ding,
The patch c15471f79506: "ocfs2: fix sparse file & data ordering issue
in direct io" from Mar 25, 2016, leads to the following static
checker warning:
fs/ocfs2/aops.c:2205 ocfs2_dio_get_block()
error: potentially dereferencing uninitialized 'wc'.
fs/ocfs2/aops.c
2196
2197 ret = ocfs2_write_begin_nolock(inode->i_mapping, pos, len,
2198 OCFS2_WRITE_DIRECT, NULL,
2199 (void **)&wc, di_bh, NULL);
2200 if (ret) {
2201 mlog_errno(ret);
2202 goto unlock;
2203 }
2204
2205 desc = &wc->w_desc[0];
2206
2207 p_blkno = ocfs2_clusters_to_blocks(inode->i_sb, desc->c_phys);
2208 BUG_ON(p_blkno == 0);
2209 p_blkno += iblock & (u64)(ocfs2_clusters_to_blocks(inode->i_sb, 1) - 1);
What it's complaining about is this code path:
fs/ocfs2/aops.c
1807
1808 /*
1809 * ocfs2_grab_pages_for_write() returns -EAGAIN if it could not lock
1810 * the target page. In this case, we exit with no error and no target
1811 * page. This will trigger the caller, page_mkwrite(), to re-try
1812 * the operation.
1813 */
1814 if (ret == -EAGAIN) {
1815 BUG_ON(wc->w_target_page);
1816 ret = 0;
1817 goto out_quota;
1818 }
1819
We return success without setting "wc". It says that the caller will
check the target page, but we are passing a NULL target page? It's not
clear to me how this works.
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-07 15:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-07 15:35 [Ocfs2-devel] [bug report] ocfs2: fix sparse file & data ordering issue in direct io Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).