Loading fs/cifsd/vfs.c +26 −15 Original line number Diff line number Diff line Loading @@ -687,17 +687,10 @@ int ksmbd_vfs_link(struct ksmbd_work *work, const char *oldname, return err; } static int __ksmbd_vfs_rename(struct ksmbd_work *work, struct dentry *src_dent_parent, struct dentry *src_dent, struct dentry *dst_dent_parent, struct dentry *trap_dent, char *dst_name) static int ksmbd_validate_entry_in_use(struct dentry *src_dent) { struct dentry *dst_dent; int err; if (!work->tcon->posix_extensions) { spin_lock(&src_dent->d_lock); list_for_each_entry(dst_dent, &src_dent->d_subdirs, d_child) { struct ksmbd_file *child_fp; Loading @@ -713,6 +706,24 @@ static int __ksmbd_vfs_rename(struct ksmbd_work *work, } } spin_unlock(&src_dent->d_lock); return 0; } static int __ksmbd_vfs_rename(struct ksmbd_work *work, struct dentry *src_dent_parent, struct dentry *src_dent, struct dentry *dst_dent_parent, struct dentry *trap_dent, char *dst_name) { struct dentry *dst_dent; int err; if (!work->tcon->posix_extensions) { err = ksmbd_validate_entry_in_use(src_dent); if (err) return err; } if (d_really_is_negative(src_dent_parent)) Loading Loading
fs/cifsd/vfs.c +26 −15 Original line number Diff line number Diff line Loading @@ -687,17 +687,10 @@ int ksmbd_vfs_link(struct ksmbd_work *work, const char *oldname, return err; } static int __ksmbd_vfs_rename(struct ksmbd_work *work, struct dentry *src_dent_parent, struct dentry *src_dent, struct dentry *dst_dent_parent, struct dentry *trap_dent, char *dst_name) static int ksmbd_validate_entry_in_use(struct dentry *src_dent) { struct dentry *dst_dent; int err; if (!work->tcon->posix_extensions) { spin_lock(&src_dent->d_lock); list_for_each_entry(dst_dent, &src_dent->d_subdirs, d_child) { struct ksmbd_file *child_fp; Loading @@ -713,6 +706,24 @@ static int __ksmbd_vfs_rename(struct ksmbd_work *work, } } spin_unlock(&src_dent->d_lock); return 0; } static int __ksmbd_vfs_rename(struct ksmbd_work *work, struct dentry *src_dent_parent, struct dentry *src_dent, struct dentry *dst_dent_parent, struct dentry *trap_dent, char *dst_name) { struct dentry *dst_dent; int err; if (!work->tcon->posix_extensions) { err = ksmbd_validate_entry_in_use(src_dent); if (err) return err; } if (d_really_is_negative(src_dent_parent)) Loading