Support #16884
closed
rename() doesn't work between directories
Added by Donatas Abraitis almost 8 years ago.
Updated about 7 years ago.
Description
Hi folks!
looks like rename() just doesn't work between directories. Here is the snippet FTP daemon does:
#include <stdio.h>
int main()
{
int rc = -1;
char *renamefrom = "/home/003/10003/test.jpg";
char *name = "/home/003/10003/public_html/test.jpg";
if (rc = rename(renamefrom, name) < 0) {
printf("%d\n", rc);
}
return 0;
}
In short, no FTP daemons are working due to this issue. Error from FTP daemon:
451 Rename/move failure: Invalid cross-device link
Thank you in advance!
Donatas.
- Project changed from Ceph to CephFS
- Category deleted (
11)
- Target version deleted (
v10.2.3)
- Tracker changed from Bug to Support
- Priority changed from Urgent to Normal
More details, please. Cross-directory rename definitely works in general. What's the output of "mount"? What versions are you running?
The only place we return EXDEV is if you're trying to rename into a snap directory, or if you have quotas set up and are crossing a "quota root". If that's the case, it's on purpose...(although you could disable the "client quota" config and get around it; I think stuff would repair successfully on subsequent mounts.)
What about removing this block at all? Or is it required too much?
Debug output is:
todir->snapid:-2 todir->quota.is_enable:0 fromdir->snapid:-2 fromdir->quota->max_files:20000 return:-18
- Assignee set to Zheng Yan
Zheng, what are the limits and requirements of that quota root EXDEV?
I think it's probably required and can't change, but I could be wrong.
guys, so what's the summary about this 'feature'?
Donatas: currently, renaming files in and out of trees with different quotas is going to give you EXDEV. You can work around it by either un-setting your quotas (you can always add them back later) or by setting "client quota = false" in your client configuration.
- Status changed from New to 4
- Status changed from 4 to Closed
- Related to Bug #39715: client: optimize rename operation under different quota root added
- Related to Bug #53509: quota support for subvolumegroup added
Also available in: Atom
PDF