From patchwork Mon Sep 21 14:43:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 11790239 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA2A9112E for ; Mon, 21 Sep 2020 14:44:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9B0B221EC for ; Mon, 21 Sep 2020 14:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbgIUOow (ORCPT ); Mon, 21 Sep 2020 10:44:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:56498 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727477AbgIUOot (ORCPT ); Mon, 21 Sep 2020 10:44:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 309A9B218; Mon, 21 Sep 2020 14:45:24 +0000 (UTC) From: Goldwyn Rodrigues To: linux-fsdevel@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, david@fromorbit.com, hch@lst.de, johannes.thumshirn@wdc.com, dsterba@suse.com, darrick.wong@oracle.com, josef@toxicpanda.com, Goldwyn Rodrigues Subject: [PATCH 15/15] iomap: Reinstate lockdep_assert_held in iomap_dio_rw() Date: Mon, 21 Sep 2020 09:43:53 -0500 Message-Id: <20200921144353.31319-16-rgoldwyn@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200921144353.31319-1-rgoldwyn@suse.de> References: <20200921144353.31319-1-rgoldwyn@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Goldwyn Rodrigues btrfs holds inode_lock_shared() while performing DIO within EOF, so lockdep_assert_held() check can be re-instated. Revert 3ad99bec6e82 ("iomap: remove lockdep_assert_held()") Signed-off-by: Goldwyn Rodrigues --- fs/iomap/direct-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index e01f81e7b76f..b5e030971001 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -421,6 +421,8 @@ __iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, struct blk_plug plug; struct iomap_dio *dio; + lockdep_assert_held(&inode->i_rwsem); + if (!count) return NULL;