Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Sep 2000 12:09:54 -0700 (PDT)
From:      Dmitry Brodsky <dima@cs.ubc.ca>
To:        freebsd-fs@freebsd.org
Subject:   stackable fs & rename problem
Message-ID:  <200009271909.MAA13804@cascade.cs.ubc.ca>

next in thread | raw e-mail | index | archive | help
Hi,

I am building a stackable FS using nullfs as a template; this is under
FreeBSD 4.0-RELEASE.  When rename is called the files being renamed 
are backed up.  So if in a directory you have a files A and B and you do
rename( A, B ), the files will first be backed up and copies will be 
made of A and B.  The problem I am having is the following:

If we have just one file A and we do rename( A, B ) then everything works
as it should.  If we also have B and we do rename( A, B ) then after
the call completes and I do an ls on the fs I get:

ls: B: Bad file descriptor

This only occurrs if B exists.  Now if I do rename( B, C ), the command
completes without any complaints and C exists and contains the contents
of A as it should.  Does anybody have any idea what might be going on.
It seems that if A and B exists and I do an vn_open on A or B then things
will get messed up.  I looked in the code for rename in kern/vfs_syscalls.c
and I don't see much of a difference in terms of paths taken in the
rename function.

Note, I do the same thing in remove without any problems.

Thanks for any help
ttyl
Dima

-- 
Dima Brodsky                                   dima@cs.ubc.ca
                                               http://www.cs.ubc.ca/~dima
201-2366 Main Mall                             (604) 822-6179 (Office)
Department of Computer Science                 (604) 822-2895 (DSG Lab)
University of British Columbia, Canada         (604) 822-5485 (FAX)

Computers are like Old Testament gods; lots of rules and no mercy.
							  (Joseph Campbell)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009271909.MAA13804>