From nobody Fri Sep 12 00:15:35 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 410F8C4167B for ; Wed, 6 Dec 2023 15:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379245AbjLFPNb (ORCPT ); Wed, 6 Dec 2023 10:13:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379228AbjLFPN3 (ORCPT ); Wed, 6 Dec 2023 10:13:29 -0500 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B797FD5E; Wed, 6 Dec 2023 07:13:34 -0800 (PST) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 8507D1E1A; Wed, 6 Dec 2023 15:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1701875228; bh=uJ8yXb35Y3nvlXGaUfbKb2hU6mLxvvg7KJ352HRIl1g=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=eDwoUKNxnC3Mgo5YqMg62nEwQlIzs9ZN6vkl1Oj/N6/RT0nvXp72F+JN+rfgOMvXZ foAWQKxkFIIu8YklSD8zsvXh7Y6NfK7Y2fLZ8YkDkPMmdNYLJax5arNk3jQiZY1W5r cPNFAPUzgIEbNaip/DtL7zgWlJgjCSwWstIw/ml0= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id C75A42117; Wed, 6 Dec 2023 15:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1701875612; bh=uJ8yXb35Y3nvlXGaUfbKb2hU6mLxvvg7KJ352HRIl1g=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=Ku8/RedgSWDEvC1aHorRRbeFaxRRq9RroNtmTSCrs4SWXGRQM6g37ggHj/tEIDN7b 3EUjBCU0mnJo9y1wgCDSBcr/wdKVNjL3KM0gP50TDKsOV84HDSDA9jUQFNyBmpKVpy Qr3UwRwAkk39i6GpMLxR/4D3cv1L7zyyfGVMbXNM= Received: from [172.16.192.129] (192.168.211.144) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 6 Dec 2023 18:13:32 +0300 Message-ID: <4f013a0c-9f3f-4a4a-88fa-17460abd702e@paragon-software.com> Date: Wed, 6 Dec 2023 18:13:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 12/16] fs/ntfs3: Implement super_operations::shutdown Content-Language: en-US From: Konstantin Komarovc To: CC: , References: <00fd1558-fda5-421b-be43-7de69e32cb4e@paragon-software.com> In-Reply-To: <00fd1558-fda5-421b-be43-7de69e32cb4e@paragon-software.com> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.211.144] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Konstantin Komarov --- =C2=A0fs/ntfs3/file.c=C2=A0=C2=A0=C2=A0 | 18 ++++++++++++++++++ =C2=A0fs/ntfs3/frecord.c |=C2=A0 3 +++ =C2=A0fs/ntfs3/inode.c=C2=A0=C2=A0 | 21 +++++++++++++++++++-- =C2=A0fs/ntfs3/namei.c=C2=A0=C2=A0 | 12 ++++++++++++ =C2=A0fs/ntfs3/ntfs_fs.h |=C2=A0 9 ++++++++- =C2=A0fs/ntfs3/super.c=C2=A0=C2=A0 | 12 ++++++++++++ =C2=A0fs/ntfs3/xattr.c=C2=A0=C2=A0 |=C2=A0 3 +++ =C2=A07 files changed, 75 insertions(+), 3 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 0ff5d3af2889..07ed3d946e7c 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -260,6 +260,9 @@ static int ntfs_file_mmap(struct file *file, struct=20 vm_area_struct *vma) =C2=A0=C2=A0=C2=A0 =C2=A0bool rw =3D vma->vm_flags & VM_WRITE; =C2=A0=C2=A0=C2=A0 =C2=A0int err; +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0if (is_encrypted(ni)) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ntfs_inode_warn(inode, "mmap e= ncrypted not supported"); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EOPNOTSUPP; @@ -677,6 +680,9 @@ int ntfs3_setattr(struct mnt_idmap *idmap, struct=20 dentry *dentry, =C2=A0=C2=A0=C2=A0 =C2=A0umode_t mode =3D inode->i_mode; =C2=A0=C2=A0=C2=A0 =C2=A0int err; +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0err =3D setattr_prepare(idmap, dentry, attr); =C2=A0=C2=A0=C2=A0 =C2=A0if (err) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0goto out; @@ -732,6 +738,9 @@ static ssize_t ntfs_file_read_iter(struct kiocb=20 *iocb, struct iov_iter *iter) =C2=A0=C2=A0=C2=A0 =C2=A0struct inode *inode =3D file->f_mapping->host; =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0if (is_encrypted(ni)) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ntfs_inode_warn(inode, "encryp= ted i/o not supported"); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EOPNOTSUPP; @@ -766,6 +775,9 @@ static ssize_t ntfs_file_splice_read(struct file=20 *in, loff_t *ppos, =C2=A0=C2=A0=C2=A0 =C2=A0struct inode *inode =3D in->f_mapping->host; =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0if (is_encrypted(ni)) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ntfs_inode_warn(inode, "encryp= ted i/o not supported"); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EOPNOTSUPP; @@ -1058,6 +1070,9 @@ static ssize_t ntfs_file_write_iter(struct kiocb=20 *iocb, struct iov_iter *from) =C2=A0=C2=A0=C2=A0 =C2=A0int err; =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0if (is_encrypted(ni)) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ntfs_inode_warn(inode, "encryp= ted i/o not supported"); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EOPNOTSUPP; @@ -1118,6 +1133,9 @@ int ntfs_file_open(struct inode *inode, struct=20 file *file) =C2=A0{ =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0if (unlikely((is_compressed(ni) || is_encrypted(n= i)) && =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (file= ->f_flags & O_DIRECT))) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EOPNOTSUPP; diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 3df2d9e34b91..8744ba36d422 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -3259,6 +3259,9 @@ int ni_write_inode(struct inode *inode, int sync,=20 const char *hint) =C2=A0=C2=A0=C2=A0 =C2=A0if (is_bad_inode(inode) || sb_rdonly(sb)) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return 0; +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0if (!ni_trylock(ni)) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0/* 'ni' is under modification,= skip for now. */ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0mark_inode_dirty_sync(inode); diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index bba0208c4afd..85452a6b1d40 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -852,9 +852,13 @@ static int ntfs_resident_writepage(struct folio *folio, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 struct writeback_control *wbc, void *data) =C2=A0{ =C2=A0=C2=A0=C2=A0 =C2=A0struct address_space *mapping =3D data; -=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(mapping->host); +=C2=A0=C2=A0 =C2=A0struct inode *inode =3D mapping->host; +=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); =C2=A0=C2=A0=C2=A0 =C2=A0int ret; +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0ni_lock(ni); =C2=A0=C2=A0=C2=A0 =C2=A0ret =3D attr_data_write_resident(ni, &folio->page= ); =C2=A0=C2=A0=C2=A0 =C2=A0ni_unlock(ni); @@ -868,7 +872,12 @@ static int ntfs_resident_writepage(struct folio *folio, =C2=A0static int ntfs_writepages(struct address_space *mapping, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 struct writeback_control *wbc) =C2=A0{ -=C2=A0=C2=A0 =C2=A0if (is_resident(ntfs_i(mapping->host))) +=C2=A0=C2=A0 =C2=A0struct inode *inode =3D mapping->host; + +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + +=C2=A0=C2=A0 =C2=A0if (is_resident(ntfs_i(inode))) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return write_cache_pages(mappi= ng, wbc, ntfs_resident_writepage, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0 mapping); =C2=A0=C2=A0=C2=A0 =C2=A0return mpage_writepages(mapping, wbc, ntfs_get_bl= ock); @@ -888,6 +897,9 @@ int ntfs_write_begin(struct file *file, struct=20 address_space *mapping, =C2=A0=C2=A0=C2=A0 =C2=A0struct inode *inode =3D mapping->host; =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0*pagep =3D NULL; =C2=A0=C2=A0=C2=A0 =C2=A0if (is_resident(ni)) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0struct page *page =3D @@ -1305,6 +1317,11 @@ struct inode *ntfs_create_inode(struct mnt_idmap=20 *idmap, struct inode *dir, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0goto out1; =C2=A0=C2=A0=C2=A0 =C2=A0} +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(sb))) { +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0err =3D -EIO; +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0goto out2; +=C2=A0=C2=A0 =C2=A0} + =C2=A0=C2=A0=C2=A0 =C2=A0/* Mark rw ntfs as dirty. it will be cleared at u= mount. */ =C2=A0=C2=A0=C2=A0 =C2=A0ntfs_set_state(sbi, NTFS_DIRTY_DIRTY); diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index ee3093be5170..cae41db0aaa7 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -181,6 +181,9 @@ static int ntfs_unlink(struct inode *dir, struct=20 dentry *dentry) =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(dir); =C2=A0=C2=A0=C2=A0 =C2=A0int err; +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(dir->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0ni_lock_dir(ni); =C2=A0=C2=A0=C2=A0 =C2=A0err =3D ntfs_unlink_inode(dir, dentry); @@ -199,6 +202,9 @@ static int ntfs_symlink(struct mnt_idmap *idmap,=20 struct inode *dir, =C2=A0=C2=A0=C2=A0 =C2=A0u32 size =3D strlen(symname); =C2=A0=C2=A0=C2=A0 =C2=A0struct inode *inode; +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(dir->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0inode =3D ntfs_create_inode(idmap, dir, dentry, N= ULL, S_IFLNK | 0777, 0, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0 symname, size, NULL); @@ -227,6 +233,9 @@ static int ntfs_rmdir(struct inode *dir, struct=20 dentry *dentry) =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(dir); =C2=A0=C2=A0=C2=A0 =C2=A0int err; +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(dir->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0ni_lock_dir(ni); =C2=A0=C2=A0=C2=A0 =C2=A0err =3D ntfs_unlink_inode(dir, dentry); @@ -264,6 +273,9 @@ static int ntfs_rename(struct mnt_idmap *idmap,=20 struct inode *dir, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= 1024); =C2=A0=C2=A0=C2=A0 =C2=A0static_assert(PATH_MAX >=3D 4 * 1024); +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0if (flags & ~RENAME_NOREPLACE) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EINVAL; diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index f6706143d14b..d40bc7669ae5 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -61,6 +61,8 @@ enum utf16_endian; =C2=A0/* sbi->flags */ =C2=A0#define NTFS_FLAGS_NODISCARD=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A00x= 00000001 +/* ntfs in shutdown state. */ +#define NTFS_FLAGS_SHUTDOWN=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A00x00000002 =C2=A0/* Set when LogFile is replaying. */ =C2=A0#define NTFS_FLAGS_LOG_REPLAYING=C2=A0=C2=A0 =C2=A00x00000008 =C2=A0/* Set when we changed first MFT's which copy must be updated in=20 $MftMirr. */ @@ -226,7 +228,7 @@ struct ntfs_sb_info { =C2=A0=C2=A0=C2=A0 =C2=A0u64 maxbytes; // Maximum size for normal files. =C2=A0=C2=A0=C2=A0 =C2=A0u64 maxbytes_sparse; // Maximum size for sparse f= ile. -=C2=A0=C2=A0 =C2=A0u32 flags; // See NTFS_FLAGS_XXX. +=C2=A0=C2=A0 =C2=A0unsigned long flags; // See NTFS_FLAGS_ =C2=A0=C2=A0=C2=A0 =C2=A0CLST zone_max; // Maximum MFT zone length in clus= ters =C2=A0=C2=A0=C2=A0 =C2=A0CLST bad_clusters; // The count of marked bad clu= sters. @@ -999,6 +1001,11 @@ static inline struct ntfs_sb_info *ntfs_sb(struct=20 super_block *sb) =C2=A0=C2=A0=C2=A0 =C2=A0return sb->s_fs_info; =C2=A0} +static inline bool ntfs3_forced_shutdown(struct super_block *sb) +{ +=C2=A0=C2=A0 =C2=A0return test_bit(NTFS_FLAGS_SHUTDOWN, &ntfs_sb(sb)->flag= s); +} + =C2=A0/* =C2=A0 * ntfs_up_cluster - Align up on cluster boundary. =C2=A0 */ diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 09d61c6c90aa..af8521a6ed95 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -714,6 +714,14 @@ static int ntfs_show_options(struct seq_file *m,=20 struct dentry *root) =C2=A0=C2=A0=C2=A0 =C2=A0return 0; =C2=A0} +/* + * ntfs_shutdown - super_operations::shutdown + */ +static void ntfs_shutdown(struct super_block *sb) +{ +=C2=A0=C2=A0 =C2=A0set_bit(NTFS_FLAGS_SHUTDOWN, &ntfs_sb(sb)->flags); +} + =C2=A0/* =C2=A0 * ntfs_sync_fs - super_operations::sync_fs =C2=A0 */ @@ -724,6 +732,9 @@ static int ntfs_sync_fs(struct super_block *sb, int=20 wait) =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni; =C2=A0=C2=A0=C2=A0 =C2=A0struct inode *inode; +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0ni =3D sbi->security.ni; =C2=A0=C2=A0=C2=A0 =C2=A0if (ni) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0inode =3D &ni->vfs_inode; @@ -763,6 +774,7 @@ static const struct super_operations ntfs_sops =3D { =C2=A0=C2=A0=C2=A0 =C2=A0.put_super =3D ntfs_put_super, =C2=A0=C2=A0=C2=A0 =C2=A0.statfs =3D ntfs_statfs, =C2=A0=C2=A0=C2=A0 =C2=A0.show_options =3D ntfs_show_options, +=C2=A0=C2=A0 =C2=A0.shutdown =3D ntfs_shutdown, =C2=A0=C2=A0=C2=A0 =C2=A0.sync_fs =3D ntfs_sync_fs, =C2=A0=C2=A0=C2=A0 =C2=A0.write_inode =3D ntfs3_write_inode, =C2=A0}; diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 4274b6f31cfa..071356d096d8 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -744,6 +744,9 @@ static int ntfs_getxattr(const struct xattr_handler=20 *handler, struct dentry *de, =C2=A0=C2=A0=C2=A0 =C2=A0int err; =C2=A0=C2=A0=C2=A0 =C2=A0struct ntfs_inode *ni =3D ntfs_i(inode); +=C2=A0=C2=A0 =C2=A0if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0return -EIO; + =C2=A0=C2=A0=C2=A0 =C2=A0/* Dispatch request. */ =C2=A0=C2=A0=C2=A0 =C2=A0if (!strcmp(name, SYSTEM_DOS_ATTRIB)) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0/* system.dos_attrib */ --=20 2.34.1