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 35A6CC6379F for ; Wed, 15 Feb 2023 13:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229627AbjBONfr (ORCPT ); Wed, 15 Feb 2023 08:35:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjBONfp (ORCPT ); Wed, 15 Feb 2023 08:35:45 -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 3343C358D; Wed, 15 Feb 2023 05:35:41 -0800 (PST) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id E50212147; Wed, 15 Feb 2023 13:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1676467889; bh=9YwbKHsq6zCe7UxAvvfw0U9eC4NOBc0GrYuoyaOiRsg=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=DCV2Dvw82s3o6RFPyqyYN0Tnm6u8pD6i3IJSiPZUUIXT3hcm7S3DQEb9Y1bzjjcdz LCThTW9xJt3J468JQtSS21GJ/DKuAXcBOajsvy3AOPGr7R26wX/Jihnc3ykI3Dk2O2 99JLC3TidCsoz1mdujuofcMB4u0gn/FUe5KzlJzQ= 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 4284E1E70; Wed, 15 Feb 2023 13:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1676468139; bh=9YwbKHsq6zCe7UxAvvfw0U9eC4NOBc0GrYuoyaOiRsg=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=A5o+lDtsQrQ0900S8R3zH3VMIsH9utchJww8A5uyU3NI92M6w0w1nnJpraji5665l +Z8SdrIKWlLBh3fU5Zha0/t3ltjjYuvPyNEaExoUgGanC+ybbCMD1xiIclZaxeAvgR 6GfjVL/y9spCDnHctON3r7vcp9dfCP6QY6jN3GvU= Received: from [192.168.211.36] (192.168.211.36) 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, 15 Feb 2023 16:35:38 +0300 Message-ID: Date: Wed, 15 Feb 2023 17:35:37 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 03/11] fs/ntfs3: Fix ntfs_create_inode() Content-Language: en-US From: Konstantin Komarov To: CC: Linux Kernel Mailing List , References: In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.211.36] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Previous variant creates an inode that requires update the parent directory (ea_packed_size). Operations in ntfs_create_inode have been rearranged so we insert new directory entry with correct ea_packed_size and new created inode does not require update it's parent directory. Signed-off-by: Konstantin Komarov --- =C2=A0fs/ntfs3/file.c=C2=A0=C2=A0=C2=A0 |=C2=A0 2 +- =C2=A0fs/ntfs3/inode.c=C2=A0=C2=A0 | 83 ++++++++++++++++++++++++----------= ------------ =C2=A0fs/ntfs3/ntfs_fs.h |=C2=A0 2 +- =C2=A0fs/ntfs3/xattr.c=C2=A0=C2=A0 | 20 ++++++----- =C2=A04 files changed, 58 insertions(+), 49 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 9cef189fc0c5..df7b76d1c127 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -703,7 +703,7 @@ int ntfs3_setattr(struct user_namespace *mnt_userns,=20 struct dentry *dentry, =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE)) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ntfs_save_wsl_perm(inode); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ntfs_save_wsl_perm(inode, NULL); =C2=A0=C2=A0=C2=A0=C2=A0 mark_inode_dirty(inode); =C2=A0out: =C2=A0=C2=A0=C2=A0=C2=A0 return err; diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 51e342ad79fd..752ad17685c0 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -1320,8 +1320,7 @@ struct inode *ntfs_create_inode(struct=20 user_namespace *mnt_userns, =C2=A0=C2=A0=C2=A0=C2=A0 inode_init_owner(mnt_userns, inode, dir, mode); =C2=A0=C2=A0=C2=A0=C2=A0 mode =3D inode->i_mode; -=C2=A0=C2=A0=C2=A0 inode->i_atime =3D inode->i_mtime =3D inode->i_ctime = =3D ni->i_crtime =3D -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 current_time(inode); +=C2=A0=C2=A0=C2=A0 ni->i_crtime =3D current_time(inode); =C2=A0=C2=A0=C2=A0=C2=A0 rec =3D ni->mi.mrec; =C2=A0=C2=A0=C2=A0=C2=A0 rec->hard_links =3D cpu_to_le16(1); @@ -1362,10 +1361,9 @@ struct inode *ntfs_create_inode(struct=20 user_namespace *mnt_userns, =C2=A0=C2=A0=C2=A0=C2=A0 attr->res.data_size =3D cpu_to_le32(dsize); =C2=A0=C2=A0=C2=A0=C2=A0 std5->cr_time =3D std5->m_time =3D std5->c_time = =3D std5->a_time =3D -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 kernel2nt(&inode->i_atime); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 kernel2nt(&ni->i_crtime); -=C2=A0=C2=A0=C2=A0 ni->std_fa =3D fa; -=C2=A0=C2=A0=C2=A0 std5->fa =3D fa; +=C2=A0=C2=A0=C2=A0 std5->fa =3D ni->std_fa =3D fa; =C2=A0=C2=A0=C2=A0=C2=A0 attr =3D Add2Ptr(attr, asize); @@ -1564,11 +1562,15 @@ struct inode *ntfs_create_inode(struct=20 user_namespace *mnt_userns, =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=C2=A0 =C2=A0=C2=A0=C2=A0 asize =3D S= IZEOF_NONRESIDENT + ALIGN(err, 8); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 /* Write non resi= dent data. */ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 err =3D ntfs_sb_w= rite_run(sbi, &ni->file.run, 0, rp, +=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=C2=A0=C2=A0 nsize, 0); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (err) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 goto out5; =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 } else { =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 attr->res.d= ata_off =3D SIZEOF_RESIDENT_LE; =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 attr->res.d= ata_size =3D cpu_to_le32(nsize); =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 memcpy(Add2= Ptr(attr, SIZEOF_RESIDENT), rp, nsize); -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 nsize =3D 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 /* Size of symlink equals the = length of input string. */ =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 inode->i_size =3D size; @@ -1589,19 +1591,8 @@ struct inode *ntfs_create_inode(struct=20 user_namespace *mnt_userns, =C2=A0=C2=A0=C2=A0=C2=A0 rec->used =3D cpu_to_le32(PtrOffset(rec, attr) + = 8); =C2=A0=C2=A0=C2=A0=C2=A0 rec->next_attr_id =3D cpu_to_le16(aid); -=C2=A0=C2=A0=C2=A0 /* Step 2: Add new name in index. */ -=C2=A0=C2=A0=C2=A0 err =3D indx_insert_entry(&dir_ni->dir, dir_ni, new_de,= sbi, fnd, 0); -=C2=A0=C2=A0=C2=A0 if (err) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out6; - -=C2=A0=C2=A0=C2=A0 /* Unlock parent directory before ntfs_init_acl. */ -=C2=A0=C2=A0=C2=A0 if (!fnd) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ni_unlock(dir_ni); - =C2=A0=C2=A0=C2=A0=C2=A0 inode->i_generation =3D le16_to_cpu(rec->seq); -=C2=A0=C2=A0=C2=A0 dir->i_mtime =3D dir->i_ctime =3D inode->i_atime; - =C2=A0=C2=A0=C2=A0=C2=A0 if (S_ISDIR(mode)) { =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 inode->i_op =3D &ntfs_dir_inod= e_operations; =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 inode->i_fop =3D &ntfs_dir_ope= rations; @@ -1626,41 +1617,58 @@ struct inode *ntfs_create_inode(struct=20 user_namespace *mnt_userns, =C2=A0=C2=A0=C2=A0=C2=A0 if (!S_ISLNK(mode) && (sb->s_flags & SB_POSIXACL)= ) { =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 err =3D ntfs_init_acl(mnt_user= ns, inode, dir); =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (err) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out7; +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out5; =C2=A0=C2=A0=C2=A0=C2=A0 } else =C2=A0#endif =C2=A0=C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 inode->i_flags |=3D S_NOSEC; =C2=A0=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 /* Write non resident data. */ -=C2=A0=C2=A0=C2=A0 if (nsize) { -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 err =3D ntfs_sb_write_run(sbi, &ni->= file.run, 0, rp, nsize, 0); -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (err) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out7; +=C2=A0=C2=A0=C2=A0 /* +=C2=A0=C2=A0=C2=A0 =C2=A0* ntfs_init_acl and ntfs_save_wsl_perm update ext= ended attribute. +=C2=A0=C2=A0=C2=A0 =C2=A0* The packed size of extended attribute is stored= in direntry too. +=C2=A0=C2=A0=C2=A0 =C2=A0* 'fname' here points to inside new_de. +=C2=A0=C2=A0=C2=A0 =C2=A0*/ +=C2=A0=C2=A0=C2=A0 ntfs_save_wsl_perm(inode, &fname->dup.ea_size); + +=C2=A0=C2=A0=C2=A0 /* +=C2=A0=C2=A0=C2=A0 =C2=A0* update ea_size in file_name attribute too. +=C2=A0=C2=A0=C2=A0 =C2=A0* Use ni_find_attr cause layout of MFT record may= be changed +=C2=A0=C2=A0=C2=A0 =C2=A0* in ntfs_init_acl and ntfs_save_wsl_perm. +=C2=A0=C2=A0=C2=A0 =C2=A0*/ +=C2=A0=C2=A0=C2=A0 attr =3D ni_find_attr(ni, NULL, NULL, ATTR_NAME, NULL, = 0, NULL, NULL); +=C2=A0=C2=A0=C2=A0 if (attr) { +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 struct ATTR_FILE_NAME *fn; + +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 fn =3D resident_data_ex(attr, SIZEOF= _ATTRIBUTE_FILENAME); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (fn) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 fn->dup.ea_size = =3D fname->dup.ea_size; =C2=A0=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0 /* We do not need to update parent directory later */ +=C2=A0=C2=A0=C2=A0 ni->ni_flags &=3D ~NI_FLAG_UPDATE_PARENT; + +=C2=A0=C2=A0=C2=A0 /* Step 2: Add new name in index. */ +=C2=A0=C2=A0=C2=A0 err =3D indx_insert_entry(&dir_ni->dir, dir_ni, new_de,= sbi, fnd, 0); +=C2=A0=C2=A0=C2=A0 if (err) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out6; + =C2=A0=C2=A0=C2=A0=C2=A0 /* =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0* Call 'd_instantiate' after inode->i_op is= set =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0* but before finish_open. =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0*/ =C2=A0=C2=A0=C2=A0=C2=A0 d_instantiate(dentry, inode); -=C2=A0=C2=A0=C2=A0 ntfs_save_wsl_perm(inode); +=C2=A0=C2=A0=C2=A0 /* Set original time. inode times (i_ctime) may be chan= ged in=20 ntfs_init_acl. */ +=C2=A0=C2=A0=C2=A0 inode->i_atime =3D inode->i_mtime =3D inode->i_ctime = =3D dir->i_mtime =3D +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 dir->i_ctime =3D ni->i_crtime; + =C2=A0=C2=A0=C2=A0=C2=A0 mark_inode_dirty(dir); =C2=A0=C2=A0=C2=A0=C2=A0 mark_inode_dirty(inode); =C2=A0=C2=A0=C2=A0=C2=A0 /* Normal exit. */ =C2=A0=C2=A0=C2=A0=C2=A0 goto out2; -out7: - -=C2=A0=C2=A0=C2=A0 /* Undo 'indx_insert_entry'. */ -=C2=A0=C2=A0=C2=A0 if (!fnd) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ni_lock_dir(dir_ni); -=C2=A0=C2=A0=C2=A0 indx_delete_entry(&dir_ni->dir, dir_ni, new_de + 1, -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 le16_to_cp= u(new_de->key_size), sbi); -=C2=A0=C2=A0=C2=A0 /* ni_unlock(dir_ni); will be called later. */ =C2=A0out6: =C2=A0=C2=A0=C2=A0=C2=A0 if (rp_inserted) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ntfs_remove_reparse(sbi, IO_RE= PARSE_TAG_SYMLINK, &new_de->ref); @@ -1682,11 +1690,11 @@ struct inode *ntfs_create_inode(struct=20 user_namespace *mnt_userns, =C2=A0=C2=A0=C2=A0=C2=A0 kfree(rp); =C2=A0out1: -=C2=A0=C2=A0=C2=A0 if (err) { -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (!fnd) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ni_unlock(dir_ni); +=C2=A0=C2=A0=C2=A0 if (!fnd) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ni_unlock(dir_ni); + +=C2=A0=C2=A0=C2=A0 if (err) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return ERR_PTR(err); -=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 unlock_new_inode(inode); @@ -1783,9 +1791,6 @@ void ntfs_evict_inode(struct inode *inode) =C2=A0{ =C2=A0=C2=A0=C2=A0=C2=A0 truncate_inode_pages_final(&inode->i_data); -=C2=A0=C2=A0=C2=A0 if (inode->i_nlink) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 _ni_write_inode(inode, inode_needs_s= ync(inode)); - =C2=A0=C2=A0=C2=A0=C2=A0 invalidate_inode_buffers(inode); =C2=A0=C2=A0=C2=A0=C2=A0 clear_inode(inode); diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 556b76f526cb..73a639716b45 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -870,7 +870,7 @@ int ntfs_acl_chmod(struct user_namespace=20 *mnt_userns, struct dentry *dentry); =C2=A0ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t s= ize); =C2=A0extern const struct xattr_handler *ntfs_xattr_handlers[]; -int ntfs_save_wsl_perm(struct inode *inode); +int ntfs_save_wsl_perm(struct inode *inode, __le16 *ea_size); =C2=A0void ntfs_get_wsl_perm(struct inode *inode); =C2=A0/* globals from lznt.c */ diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index c42fbc56eb39..e7a66225361d 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -296,7 +296,8 @@ static int ntfs_get_ea(struct inode *inode, const=20 char *name, size_t name_len, =C2=A0static noinline int ntfs_set_ea(struct inode *inode, const char *nam= e, =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 size_t name_len, const void *value, -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 size_t val_size, int flags, bool locked) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 size_t val_size, int flags, bool locked, +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 __le16 *ea_size) =C2=A0{ =C2=A0=C2=A0=C2=A0=C2=A0 struct ntfs_inode *ni =3D ntfs_i(inode); =C2=A0=C2=A0=C2=A0=C2=A0 struct ntfs_sb_info *sbi =3D ni->mi.sbi; @@ -504,6 +505,8 @@ static noinline int ntfs_set_ea(struct inode *inode,=20 const char *name, =C2=A0=C2=A0=C2=A0=C2=A0 if (ea_info.size_pack !=3D size_pack) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ni->ni_flags |=3D NI_FLAG_UPDA= TE_PARENT; +=C2=A0=C2=A0=C2=A0 if (ea_size) +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 *ea_size =3D ea_info.size_pack; =C2=A0=C2=A0=C2=A0=C2=A0 mark_inode_dirty(&ni->vfs_inode); =C2=A0out: @@ -633,7 +636,7 @@ static noinline int ntfs_set_acl_ex(struct=20 user_namespace *mnt_userns, =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 flags =3D 0; =C2=A0=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 err =3D ntfs_set_ea(inode, name, name_len, value, size,= flags, 0); +=C2=A0=C2=A0=C2=A0 err =3D ntfs_set_ea(inode, name, name_len, value, size,= flags, 0, NULL); =C2=A0=C2=A0=C2=A0=C2=A0 if (err =3D=3D -ENODATA && !size) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 err =3D 0; /* Removing non exi= sted xattr. */ =C2=A0=C2=A0=C2=A0=C2=A0 if (!err) { @@ -923,7 +926,8 @@ static noinline int ntfs_setxattr(const struct=20 xattr_handler *handler, =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 /* Deal with NTFS extended attribute. */ -=C2=A0=C2=A0=C2=A0 err =3D ntfs_set_ea(inode, name, strlen(name), value, s= ize, flags, 0); +=C2=A0=C2=A0=C2=A0 err =3D ntfs_set_ea(inode, name, strlen(name), value, s= ize, flags, 0, +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 NULL); =C2=A0out: =C2=A0=C2=A0=C2=A0=C2=A0 inode->i_ctime =3D current_time(inode); @@ -937,7 +941,7 @@ static noinline int ntfs_setxattr(const struct=20 xattr_handler *handler, =C2=A0 * =C2=A0 * save uid/gid/mode in xattr =C2=A0 */ -int ntfs_save_wsl_perm(struct inode *inode) +int ntfs_save_wsl_perm(struct inode *inode, __le16 *ea_size) =C2=A0{ =C2=A0=C2=A0=C2=A0=C2=A0 int err; =C2=A0=C2=A0=C2=A0=C2=A0 __le32 value; @@ -946,26 +950,26 @@ int ntfs_save_wsl_perm(struct inode *inode) =C2=A0=C2=A0=C2=A0=C2=A0 ni_lock(ni); =C2=A0=C2=A0=C2=A0=C2=A0 value =3D cpu_to_le32(i_uid_read(inode)); =C2=A0=C2=A0=C2=A0=C2=A0 err =3D ntfs_set_ea(inode, "$LXUID", sizeof("$LXU= ID") - 1, &value, -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 sizeof(val= ue), 0, true); /* true =3D=3D already locked. */ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 sizeof(val= ue), 0, true, ea_size); =C2=A0=C2=A0=C2=A0=C2=A0 if (err) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out; =C2=A0=C2=A0=C2=A0=C2=A0 value =3D cpu_to_le32(i_gid_read(inode)); =C2=A0=C2=A0=C2=A0=C2=A0 err =3D ntfs_set_ea(inode, "$LXGID", sizeof("$LXG= ID") - 1, &value, -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 sizeof(val= ue), 0, true); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 sizeof(val= ue), 0, true, ea_size); =C2=A0=C2=A0=C2=A0=C2=A0 if (err) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out; =C2=A0=C2=A0=C2=A0=C2=A0 value =3D cpu_to_le32(inode->i_mode); =C2=A0=C2=A0=C2=A0=C2=A0 err =3D ntfs_set_ea(inode, "$LXMOD", sizeof("$LXM= OD") - 1, &value, -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 sizeof(val= ue), 0, true); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 sizeof(val= ue), 0, true, ea_size); =C2=A0=C2=A0=C2=A0=C2=A0 if (err) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out; =C2=A0=C2=A0=C2=A0=C2=A0 if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mo= de)) { =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 value =3D cpu_to_le32(inode->i= _rdev); =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 err =3D ntfs_set_ea(inode, "$L= XDEV", sizeof("$LXDEV") - 1, &value, -=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 sizeof(value), 0, true); +=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 sizeof(value), 0, true, ea_size); =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (err) =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 goto out; =C2=A0=C2=A0=C2=A0=C2=A0 } --=20 2.34.1