rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] rdiff to SMB share?


From: Cengiz Gunay
Subject: Re: [rdiff-backup-users] rdiff to SMB share?
Date: Thu, 12 Jan 2006 11:55:12 -0500 (EST)

On Wed, 11 Jan 2006, Ben Escoto wrote:

> ... 
> Do if you just try to rmdir a directory that has files in it, do you
> get that same "Device or resource busy" error?  ...

Nope, I get "directory not empty".

> If that's what's happening you can try using lsof (or maybe strace) to
> see if rdiff-backup is leaving any files open when it tries to remove
> the directory.  I looked through the relevant code for about 5 minutes
> and it seems to me all the files get closed.

You were right on this. I was looking at the /proc/.../fd for open files, 
but lsof (I didn't know about this one!) is a better way to visualize it:

---
> lsof rdiff-backup.tmp.4
COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME
python  24765 cengiz    3r   DIR    0,0 4096 4920 rdiff-backup.tmp.4
---

And that is the directory it is about to remove after the loop. I can give 
you some clues on where it may be in the code by looking at the strace 
output:

---
...
open("/Lab/cengiz/emory/cgunay/home_backup/rdiff-backup-data/rdiff-backup.tmp.4/
hardlinked_file1", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=0, ...}) = 0
close(3)                                = 0
lstat("/Lab/cengiz/emory/cgunay/home_backup/rdiff-backup-data/rdiff-backup.tmp.4
/hardlinked_file1", {st_mode=S_IFREG|0755, st_size=0, ...}) = 0
link("/Lab/cengiz/emory/cgunay/home_backup/rdiff-backup-data/rdiff-backup.tmp.4/
hardlinked_file1", 
"/Lab/cengiz/emory/cgunay/home_backup/rdiff-backup-data/rdiff
-backup.tmp.4/hl/hardlinked_file2") = -1 EPERM (Operation not permitted)
open("/Lab/cengiz/emory/cgunay/home_backup/rdiff-backup-data/rdiff-backup.tmp.4"
, O_RDONLY) = 3
fsync(3)                                = -1 EINVAL (Invalid argument)
...
---

So rdiff-backup opens a handle to the directory itself, right after doing 
the hardlink test within the directory. This handle is never closed until 
the point we're interested in.

> But if removing a non-empty directory gives you the more common
> "Directory not empty" (ENOTEMPTY) error, leaving files open may not be
> the problem.  Maybe someone else could tell you why trying to remove
> an empty SMB directory would raise an EBUSY.

If you can tell me where to put the close function, I can test this 
easily.

Cengiz Gunay
--
address@hidden  address@hidden (MSN)    address@hidden
Lab: +1-404-727-3565    Home/Cell: +1-678-559-8694
http://userwww.service.emory.edu/~cgunay/
IMs: ICQ# 21104923, address@hidden,yahoo.com,Skype}
--




reply via email to

[Prev in Thread] Current Thread [Next in Thread]