diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-06-18 11:42:53 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-30 14:39:47 -0700 |
commit | f76cea526e01055bedb51a2b318f4d711e0144c4 (patch) | |
tree | e7415a1c3f026b4566e4a5f0987da4991e9ecdaa | |
parent | c637cbe1701c396f8c3dbf0b11c0c77d70980618 (diff) |
nilfs2: remove unlikely directive causing mis-conversion of error code
commit 0cfae3d8795f388f9de78adb0171520d19da77e9 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 22c7f65c2403..16b6c47755ff 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -1846,8 +1846,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; |