Skip to contentSkip to conversation

fs: return error on error condition

PATCH In review Nicolas Kaiser 3 participants 3 messages Oct 20, 2010 – Oct 21, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: return error on error condition

It's intended to return an error, right?

---
 fs/pipe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/pipe.c +1 -1
index 279eef9..37eb1eb 100644
@@ -382,7 +382,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
 			error = ops->confirm(pipe, buf);
 			if (error) {
 				if (!ret)
-					error = ret;
+					ret = error;
 				break;
 			}
 
Signature · 1 line
1.7.2.2
#1 lore raw
Quoted 12 lines · Nicolas Kaiser

It's intended to return an error, right?

---
fs/pipe.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
fs/pipe.c +0 -0
index 279eef9..37eb1eb 100644

fs/pipe.c pipe_read(struct kiocb *iocb, const struct iovec *_iov, · line 388

Quoted 8 lines
fs/pipe.c +1 -1
@@ -382,7 +382,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
 			error = ops->confirm(pipe, buf);
 			if (error) {
 				if (!ret)
-					error = ret;
+					ret = error;
 				break;
 			}
 

Wow, I think you are right. :)

#2 lore raw
In reply to Nicolas Kaiser
Quoted 12 lines · Nicolas Kaiser

It's intended to return an error, right?

---
 fs/pipe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/pipe.c +0 -0
index 279eef9..37eb1eb 100644

fs/pipe.c pipe_read(struct kiocb *iocb, const struct iovec *_iov, · line 388

Quoted 8 lines
fs/pipe.c +1 -1
@@ -382,7 +382,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
 			error = ops->confirm(pipe, buf);
 			if (error) {
 				if (!ret)
-					error = ret;
+					ret = error;
 				break;
 			}
 

Thanks, that is indeed a bug. I'll commit and mark for stable.

Signature · 1 line
Jens Axboe