In a later patch, I'll be adding a test for F_GETLK that will require
that we open the file with a different f_mode. Change do_open not to
assume that the it needs to open the file O_RDWR.
While we're at it, fix a bug in do_open. Just because we pass in '0' for
the flags, doesn't mean that this is the initial open. Move the exit(1)
for that case to the caller.
Signed-off-by: Jeff Layton <jlayton@poochiereds.net> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>