From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.cz>,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-nvdimm@lists.01.org, Ted Tso <tytso@mit.edu>
Subject: Re: [PATCH 2/2] dax: assert that i_rwsem is held exclusive for writes
Date: Wed, 11 Jan 2017 10:02:50 +0100 [thread overview]
Message-ID: <20170111090250.GF16116@quack2.suse.cz> (raw)
In-Reply-To: <1484063288-18255-3-git-send-email-hch@lst.de>
On Tue 10-01-17 16:48:08, Christoph Hellwig wrote:
> Make sure all callers follow the same locking protocol, given that DAX
> transparantly replaced the normal buffered I/O path.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Probably also for Ted since it depends on the ext4 fix...
Honza
> ---
> fs/dax.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 5c74f60..04734da 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -1061,8 +1061,12 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
> loff_t pos = iocb->ki_pos, ret = 0, done = 0;
> unsigned flags = 0;
>
> - if (iov_iter_rw(iter) == WRITE)
> + if (iov_iter_rw(iter) == WRITE) {
> + lockdep_assert_held_exclusive(&inode->i_rwsem);
> flags |= IOMAP_WRITE;
> + } else {
> + lockdep_assert_held(&inode->i_rwsem);
> + }
>
> while (iov_iter_count(iter)) {
> ret = iomap_apply(inode, pos, iov_iter_count(iter), flags, ops,
> --
> 2.1.4
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2017-01-11 9:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-10 15:48 fix write synchronization for DAX Christoph Hellwig
2017-01-10 15:48 ` [PATCH 1/2] ext4: fix DAX write locking Christoph Hellwig
2017-01-11 9:01 ` Jan Kara
2017-02-08 17:14 ` Christoph Hellwig
2017-02-08 19:38 ` Theodore Ts'o
2017-02-08 19:41 ` Theodore Ts'o
2017-01-10 15:48 ` [PATCH 2/2] dax: assert that i_rwsem is held exclusive for writes Christoph Hellwig
2017-01-11 9:02 ` Jan Kara [this message]
2017-02-08 19:43 ` Theodore Ts'o
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=20170111090250.GF16116@quack2.suse.cz \
--to=jack@suse.cz \
--cc=hch@lst.de \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=tytso@mit.edu \
/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).