Support #16884
rename() doesn't work between directories
0%
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.
Related issues
History
#1 Updated by Nathan Cutler over 7 years ago
- Project changed from Ceph to CephFS
- Category deleted (
11)
#2 Updated by Nathan Cutler over 7 years ago
- Target version deleted (
v10.2.3)
#3 Updated by Greg Farnum over 7 years ago
- 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.)
#4 Updated by Donatas Abraitis over 7 years ago
Looks like this part is failing: https://github.com/ceph/ceph/blob/0080b6bc92cefdd2115c904fd0c83ae83c9c2f01/src/client/Client.cc#L10974-L10979
#5 Updated by Donatas Abraitis over 7 years ago
What about removing this block at all? Or is it required too much?
#6 Updated by Donatas Abraitis over 7 years ago
Debug output is:
todir->snapid:-2 todir->quota.is_enable:0 fromdir->snapid:-2 fromdir->quota->max_files:20000 return:-18
#7 Updated by Greg Farnum over 7 years ago
- 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.
#8 Updated by Donatas Abraitis over 7 years ago
guys, so what's the summary about this 'feature'?
#9 Updated by John Spray over 7 years ago
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.
#10 Updated by Zheng Yan almost 7 years ago
- Status changed from New to 4
#11 Updated by Zheng Yan almost 7 years ago
- Status changed from 4 to Closed
#12 Updated by Patrick Donnelly almost 5 years ago
- Related to Bug #39715: client: optimize rename operation under different quota root added
#13 Updated by Kotresh Hiremath Ravishankar over 2 years ago
- Related to Bug #53509: quota support for subvolumegroup added