Bug 179511 - fs: ocfs2: uptodate.c: set_buffer_uptodate(bh) is not clearing if __ocfs2_set_buffer_uptodate fails, which it can.
Summary: fs: ocfs2: uptodate.c: set_buffer_uptodate(bh) is not clearing if __ocfs2_set...
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: ocfs2 (show other bugs)
Hardware: All Linux
: P1 low
Assignee: io_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-21 10:03 UTC by Michael
Modified: 2016-11-06 19:20 UTC (History)
1 user (show)

See Also:
Kernel Version: Linux 4.9
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Michael 2016-10-21 10:03:51 UTC
In ocfs2_set_new_buffer_uptodate, the slow path in ocfs2_set_buffer_uptodate may fail, but ocfs2_set_new_buffer_uptodate will return without calling  clear_buffer_uptodate(bh). This may never occur in runtime.

Based on static analysis using PALLAS.
Comment 1 Michael 2016-10-27 19:01:03 UTC
Specifically:

set_buffer_uptodate(bh);

ocfs2_metadata_cache_io_lock(ci);
ocfs2_set_buffer_uptodate(ci, bh);
ocfs2_metadata_cache_io_unlock(ci);

If these two functions are correlated (via <bh>), should they be in the locked portion together?

If set_buffer_uptodate is cleared in another thread, how does that affect ocfs2_set_buffer_uptodate?

Note You need to log in before you can comment on or make changes to this bug.