diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-06-17 22:42:53 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-07-04 21:44:19 -0400 |
commit | 0cfae3d8795f388f9de78adb0171520d19da77e9 (patch) | |
tree | 4f4e447edc025cb1f96ac27da030b8b36164865b /fs/nilfs2 | |
parent | 8e4a718ff38d8539938ec3421935904c27e00c39 (diff) |
nilfs2: remove unlikely directive causing mis-conversion of error code
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
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/segment.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index aa977549919e..c1824915c1c7 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -1829,8 +1829,8 @@ static int nilfs_segctor_write(struct nilfs_sc_info *sci, | |||
1829 | err = nilfs_segbuf_write(segbuf, &wi); | 1829 | err = nilfs_segbuf_write(segbuf, &wi); |
1830 | 1830 | ||
1831 | res = nilfs_segbuf_wait(segbuf, &wi); | 1831 | res = nilfs_segbuf_wait(segbuf, &wi); |
1832 | err = unlikely(err) ? : res; | 1832 | err = err ? : res; |
1833 | if (unlikely(err)) | 1833 | if (err) |
1834 | return err; | 1834 | return err; |
1835 | } | 1835 | } |
1836 | return 0; | 1836 | return 0; |