[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PUZPR04MB631625FD025D0762D36578118101A@PUZPR04MB6316.apcprd04.prod.outlook.com>
Date: Wed, 3 Sep 2025 01:59:06 +0000
From: "Yuezhang.Mo@...y.com" <Yuezhang.Mo@...y.com>
To: Ethan Ferguson <ethan.ferguson@...ier.com>
CC: "linkinjeon@...nel.org" <linkinjeon@...nel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"sj1557.seo@...sung.com" <sj1557.seo@...sung.com>
Subject: Re: [PATCH v4 0/1] exfat: Add support for FS_IOC_{GET,SET}FSLABEL
> >> + clu.size = 0;
> >> + old_clu = clu.dir;
> >> + ret = exfat_alloc_cluster(root_inode, 1,
> >> + &clu, true);
> >> + if (ret < 0) {
> >> + brelse(bh);
> >> + goto end;
> >> + }
> >
> > In exFAT, directory size is limited to 256MB. Please add a check to return -ENOSPC
> > instead of allocating a new cluster if the root directory size had reached this limit.
> >
> Noted. I am switching over to using exfat_find_empty_entry, which
> checks for this.
I think it is good way to use exfat_find_empty_entry.
In exfat_get_volume_label_ptrs, if an empty dentry is found, ei->hint_femp should be
set to avoid repeated traversal.
> >> +
> >> + ret = exfat_ent_set(sb, old_clu, clu.dir);
> >> + if (ret < 0) {
> >> + exfat_free_cluster(root_inode, &clu);
> >> + brelse(bh);
> >> + goto end;
> >> + }
> >> +
> >> + ret = exfat_zeroed_cluster(root_inode, clu.dir);
> >> + if (ret < 0) {
> >> + exfat_free_cluster(root_inode, &clu);
> >> + brelse(bh);
> >> + goto end;
> >> + }
> >
> > After allocating a new cluster for the root directory, its size needs to be updated.
> >
> Where would I update the size? I don't think the root directory has a
> Stream Extension dentry, would I increment the exfat_inode_info.dir.size
> field?
The root directory does not have a Stream Extension dentry. We just need to update
the new size to root_inode->i_size. If exfat_find_empty_entry is used, root_inode->i_size
will be updated by it.
Powered by blists - more mailing lists