mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-10 21:50:20 +00:00
scoutfs: create offline extents after arg checks
With the introduction of packed extent items the setattr_more ioctl had to be careful not to try and dirty all the extent items in one transaction. But it pulled the extent creation call up to high and was doing it before some argument checks that were done after the inode was refreshed by acquiring its lock. This moves the extent creation to be done after the args are verified for the inode. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -590,13 +590,6 @@ static long scoutfs_ioc_setattr_more(struct file *file, unsigned long arg)
|
||||
if (ret)
|
||||
goto unlock;
|
||||
|
||||
/* create offline extents in potentially many transactions */
|
||||
if (sm.flags & SCOUTFS_IOC_SETATTR_MORE_OFFLINE) {
|
||||
ret = scoutfs_data_init_offline_extent(inode, sm.i_size, lock);
|
||||
if (ret)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
/* can only change size/dv on untouched regular files */
|
||||
if ((sm.i_size != 0 || sm.data_version != 0) &&
|
||||
((!S_ISREG(inode->i_mode) ||
|
||||
@@ -605,6 +598,13 @@ static long scoutfs_ioc_setattr_more(struct file *file, unsigned long arg)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
/* create offline extents in potentially many transactions */
|
||||
if (sm.flags & SCOUTFS_IOC_SETATTR_MORE_OFFLINE) {
|
||||
ret = scoutfs_data_init_offline_extent(inode, sm.i_size, lock);
|
||||
if (ret)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
/* setting only so we don't see 0 data seq with nonzero data_version */
|
||||
set_data_seq = sm.data_version != 0 ? true : false;
|
||||
ret = scoutfs_inode_index_lock_hold(inode, &ind_locks, set_data_seq,
|
||||
|
||||
Reference in New Issue
Block a user