Skip to content

Commit

Permalink
nilfs2: remove unlikely directive causing mis-conversion of error code
Browse files Browse the repository at this point in the history
The following error code handling in nilfs_segctor_write() function
wrongly converted negative error codes to a truth value (i.e. 1):

   err = unlikely(err) ? : res;

which originaly meant to be

   err = err ? : res;

This mis-conversion caused that write or sync functions receive the
unexpected error code.  This fixes the bug by removing the unlikely
directive.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: stable@kernel.org
  • Loading branch information
Ryusuke Konishi committed Jul 5, 2009
1 parent 8e4a718 commit 0cfae3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/nilfs2/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -1829,8 +1829,8 @@ static int nilfs_segctor_write(struct nilfs_sc_info *sci,
err = nilfs_segbuf_write(segbuf, &wi);

res = nilfs_segbuf_wait(segbuf, &wi);
err = unlikely(err) ? : res;
if (unlikely(err))
err = err ? : res;
if (err)
return err;
}
return 0;
Expand Down

0 comments on commit 0cfae3d

Please sign in to comment.