mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag 'for-6.12-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fixes from David Sterba:
"A few more one-liners that fix some user visible problems:
- use correct range when clearing qgroup reservations after COW
- properly reset freed delayed ref list head
- fix ro/rw subvolume mounts to be backward compatible with old and
new mount API"
* tag 'for-6.12-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: fix the length of reserved qgroup to free
btrfs: reinitialize delayed ref list after deleting it from the list
btrfs: fix per-subvolume RO/RW flags with new mount API
This commit is contained in:
@@ -649,7 +649,7 @@ static bool insert_delayed_ref(struct btrfs_trans_handle *trans,
|
||||
&href->ref_add_list);
|
||||
else if (ref->action == BTRFS_DROP_DELAYED_REF) {
|
||||
ASSERT(!list_empty(&exist->add_list));
|
||||
list_del(&exist->add_list);
|
||||
list_del_init(&exist->add_list);
|
||||
} else {
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
@@ -1618,7 +1618,7 @@ out_unlock:
|
||||
clear_bits |= EXTENT_CLEAR_DATA_RESV;
|
||||
extent_clear_unlock_delalloc(inode, start, end, locked_folio,
|
||||
&cached, clear_bits, page_ops);
|
||||
btrfs_qgroup_free_data(inode, NULL, start, cur_alloc_size, NULL);
|
||||
btrfs_qgroup_free_data(inode, NULL, start, end - start + 1, NULL);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1979,25 +1979,10 @@ error:
|
||||
* fsconfig(FSCONFIG_SET_FLAG, "ro"). This option is seen by the filesystem
|
||||
* in fc->sb_flags.
|
||||
*
|
||||
* This disambiguation has rather positive consequences. Mounting a subvolume
|
||||
* ro will not also turn the superblock ro. Only the mount for the subvolume
|
||||
* will become ro.
|
||||
*
|
||||
* So, if the superblock creation request comes from the new mount API the
|
||||
* caller must have explicitly done:
|
||||
*
|
||||
* fsconfig(FSCONFIG_SET_FLAG, "ro")
|
||||
* fsmount/mount_setattr(MOUNT_ATTR_RDONLY)
|
||||
*
|
||||
* IOW, at some point the caller must have explicitly turned the whole
|
||||
* superblock ro and we shouldn't just undo it like we did for the old mount
|
||||
* API. In any case, it lets us avoid the hack in the new mount API.
|
||||
*
|
||||
* Consequently, the remounting hack must only be used for requests originating
|
||||
* from the old mount API and should be marked for full deprecation so it can be
|
||||
* turned off in a couple of years.
|
||||
*
|
||||
* The new mount API has no reason to support this hack.
|
||||
* But, currently the util-linux mount command already utilizes the new mount
|
||||
* API and is still setting fsconfig(FSCONFIG_SET_FLAG, "ro") no matter if it's
|
||||
* btrfs or not, setting the whole super block RO. To make per-subvolume mounting
|
||||
* work with different options work we need to keep backward compatibility.
|
||||
*/
|
||||
static struct vfsmount *btrfs_reconfigure_for_mount(struct fs_context *fc)
|
||||
{
|
||||
@@ -2019,7 +2004,7 @@ static struct vfsmount *btrfs_reconfigure_for_mount(struct fs_context *fc)
|
||||
if (IS_ERR(mnt))
|
||||
return mnt;
|
||||
|
||||
if (!fc->oldapi || !ro2rw)
|
||||
if (!ro2rw)
|
||||
return mnt;
|
||||
|
||||
/* We need to convert to rw, call reconfigure. */
|
||||
|
||||
Reference in New Issue
Block a user