linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: lkml <linux-kernel@vger.kernel.org>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	Ian Abbott <abbotti@mev.co.uk>
Subject: [PATCH] UDF: Fix incorrect error handling in udf_direct_IO()
Date: Thu,  6 Sep 2012 11:08:11 +0100	[thread overview]
Message-ID: <1346926091-3654-1-git-send-email-abbotti@mev.co.uk> (raw)
In-Reply-To: <20120905190239.GK18051@quack.suse.cz>

My recent patch to add DIRECT_IO support to the UDF filesystem handler
contains a mistake in the error recovery if blockdev_direct_IO() fails.
The test `rw && WRITE` should be `rw & WRITE`.  Fix it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 fs/udf/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index b905448..41d5830 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -156,7 +156,7 @@ static ssize_t udf_direct_IO(int rw, struct kiocb *iocb,
 
 	ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
 				  udf_get_block);
-	if (unlikely(ret < 0 && (rw && WRITE)))
+	if (unlikely(ret < 0 && (rw & WRITE)))
 		udf_write_failed(mapping, offset + iov_length(iov, nr_segs));
 	return ret;
 }
-- 
1.7.12


  reply	other threads:[~2012-09-06 10:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24 12:17 [PATCH] UDF: Add support for O_DIRECT Ian Abbott
2012-07-31 10:40 ` [PATCH v2] " Ian Abbott
2012-09-04  9:49   ` [PATCH v3] " Ian Abbott
2012-09-04 14:39     ` Jan Kara
2012-09-04 15:11       ` Ian Abbott
2012-09-05  9:03         ` Ian Abbott
2012-09-05 12:05         ` Jan Kara
2012-09-05 12:55           ` Jan Kara
2012-09-05 16:00             ` Jan Kara
2012-09-05 16:44               ` [PATCH v4] " Ian Abbott
2012-09-05 19:02                 ` Jan Kara
2012-09-06 10:08                   ` Ian Abbott [this message]
2012-09-06 14:22                     ` [PATCH] UDF: Fix incorrect error handling in udf_direct_IO() Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346926091-3654-1-git-send-email-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).