File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -9226,8 +9226,14 @@ static int btrfs_rename_exchange(struct inode *old_dir,
9226
9226
bool dest_log_pinned = false;
9227
9227
bool need_abort = false;
9228
9228
9229
- /* we only allow rename subvolume link between subvolumes */
9230
- if (old_ino != BTRFS_FIRST_FREE_OBJECTID && root != dest )
9229
+ /*
9230
+ * For non-subvolumes allow exchange only within one subvolume, in the
9231
+ * same inode namespace. Two subvolumes (represented as directory) can
9232
+ * be exchanged as they're a logical link and have a fixed inode number.
9233
+ */
9234
+ if (root != dest &&
9235
+ (old_ino != BTRFS_FIRST_FREE_OBJECTID ||
9236
+ new_ino != BTRFS_FIRST_FREE_OBJECTID ))
9231
9237
return - EXDEV ;
9232
9238
9233
9239
/* close the race window with snapshot create/destroy ioctl */
You can’t perform that action at this time.
0 commit comments