linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH v1] exfat: remove the code that sets FileAttributes when renaming
       [not found] ` <tencent_C77E59E94CE232025C1A0EA7642E22A9F708@qq.com>
@ 2022-09-14  8:48   ` Sungjong Seo
  0 siblings, 0 replies; only message in thread
From: Sungjong Seo @ 2022-09-14  8:48 UTC (permalink / raw)
  To: 'Rover', 'linkinjeon'
  Cc: 'linux-kernel', 'linux-fsdevel', sj1557.seo

Hi, Rover,

This patch seems to violate the exFAT specification below.
Please refer to the description for ATTR_ARCHIVE in FAT32 Spec.

* Archive
This field is mandatory and conforms to the MS-DOS definition.

* ATTR_ARCHIVE
This attribute supports backup utilities. This bit is set by the FAT file
system driver when a file is created, renamed, or written to. Backup
utilities may use this attribute to indicate which files on the volume
have been modified since the last time that a backup was performed.

Thanks.
B.R.

Sungjong Seo

> When renaming, FileAttributes remain unchanged, do not need to be
> set, so the code that sets FileAttributes is unneeded, remove it.
> 
> Signed-off-by: rover &lt;739817562@qq.com&gt;
> ---
>  fs/exfat/namei.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
> index b617bebc3d0f..5ffaf553155e 100644
> --- a/fs/exfat/namei.c
> +++ b/fs/exfat/namei.c
> @@ -1031,10 +1031,6 @@ static int exfat_rename_file(struct inode *inode,
> struct exfat_chain *p_dir,
>  			return -EIO;
> 
>  		*epnew = *epold;
> -		if (exfat_get_entry_type(epnew) == TYPE_FILE) {
> -			epnew-&gt;dentry.file.attr |=
> cpu_to_le16(ATTR_ARCHIVE);
> -			ei-&gt;attr |= ATTR_ARCHIVE;
> -		}
>  		exfat_update_bh(new_bh, sync);
>  		brelse(old_bh);
>  		brelse(new_bh);
> @@ -1063,10 +1059,6 @@ static int exfat_rename_file(struct inode *inode,
> struct exfat_chain *p_dir,
>  		ei-&gt;dir = *p_dir;
>  		ei-&gt;entry = newentry;
>  	} else {
> -		if (exfat_get_entry_type(epold) == TYPE_FILE) {
> -			epold-&gt;dentry.file.attr |=
> cpu_to_le16(ATTR_ARCHIVE);
> -			ei-&gt;attr |= ATTR_ARCHIVE;
> -		}
>  		exfat_update_bh(old_bh, sync);
>  		brelse(old_bh);
>  		ret = exfat_init_ext_entry(inode, p_dir, oldentry,
> @@ -1112,10 +1104,6 @@ static int exfat_move_file(struct inode *inode,
> struct exfat_chain *p_olddir,
>  		return -EIO;
> 
>  	*epnew = *epmov;
> -	if (exfat_get_entry_type(epnew) == TYPE_FILE) {
> -		epnew-&gt;dentry.file.attr |= cpu_to_le16(ATTR_ARCHIVE);
> -		ei-&gt;attr |= ATTR_ARCHIVE;
> -	}
>  	exfat_update_bh(new_bh, IS_DIRSYNC(inode));
>  	brelse(mov_bh);
>  	brelse(new_bh);
> --
> 2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-14  8:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20220909033708epcas1p23af4e173c0594a578b52cc59bcbeaacc@epcas1p2.samsung.com>
     [not found] ` <tencent_C77E59E94CE232025C1A0EA7642E22A9F708@qq.com>
2022-09-14  8:48   ` [PATCH v1] exfat: remove the code that sets FileAttributes when renaming Sungjong Seo

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).