Re: [PATCH 2/2] vfs: Get rid of duplicate file_ops check in do_readv_writev()

2013-09-29 Thread Al Viro
On Sun, Sep 29, 2013 at 06:37:50PM +0900, Namhyung Kim wrote:
> The file->f_op check in do_readv_writev() is redundant since all of
> its caller (vfs_readv and vfs_writev) already did the check.  The
> same goes to compat_do_readv_writev().

... and the right fix is to kill all those checks completely.  I have that
done in local queue; will push to #for-next tonight.  file->f_op should
never be NULL, period.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] vfs: Get rid of duplicate file_ops check in do_readv_writev()

2013-09-29 Thread Namhyung Kim
The file->f_op check in do_readv_writev() is redundant since all of
its caller (vfs_readv and vfs_writev) already did the check.  The
same goes to compat_do_readv_writev().

Signed-off-by: Namhyung Kim 
---
 fs/read_write.c |9 -
 1 file changed, 9 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 878f40e50451..a8bcdd26b16e 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -721,11 +721,6 @@ static ssize_t do_readv_writev(int type, struct file *file,
io_fn_t fn;
iov_fn_t fnv;
 
-   if (!file->f_op) {
-   ret = -EINVAL;
-   goto out;
-   }
-
ret = rw_copy_check_uvector(type, uvector, nr_segs,
ARRAY_SIZE(iovstack), iovstack, &iov);
if (ret <= 0)
@@ -894,10 +889,6 @@ static ssize_t compat_do_readv_writev(int type, struct 
file *file,
io_fn_t fn;
iov_fn_t fnv;
 
-   ret = -EINVAL;
-   if (!file->f_op)
-   goto out;
-
ret = -EFAULT;
if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
goto out;
-- 
1.7.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/