Bug 179511

Summary: fs: ocfs2: uptodate.c: set_buffer_uptodate(bh) is not clearing if __ocfs2_set_buffer_uptodate fails, which it can.
Product: File System Reporter: Michael (michael_allen_bond)
Component: ocfs2Assignee: io_other
Status: NEW ---    
Severity: low CC: szg00000
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Linux 4.9 Subsystem:
Regression: No Bisected commit-id:

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?