[LU-6497] strange code in ll_page_mkwrite0 Created: 25/Apr/15 Updated: 25/Apr/15 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Oleg Drokin | Assignee: | WC Triage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
I am playing with new version of smatch and it highlighted this interesting piece in ll_page_mkwrite0: if (result == 0) {
struct inode *inode = vma->vm_file->f_dentry->d_inode;
struct ll_inode_info *lli = ll_i2info(inode);
lock_page(vmpage);
if (vmpage->mapping == NULL) {
unlock_page(vmpage);
/* page was truncated and lock was cancelled, return
* ENODATA so that VM_FAULT_NOPAGE will be returned
* to handle_mm_fault(). */
if (result == 0)
result = -ENODATA;
So we are on a path that already checked result to be 0 and then we check again? Is there a missing call to somewhere? |