diff options
author | Thomas Bushnell <thomas@gnu.org> | 1996-08-13 20:09:00 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1996-08-13 20:09:00 +0000 |
commit | 7f95a8a4c1a999bee77a323489341505abe2d3db (patch) | |
tree | b75b85bc8d298d7b0b015d2a9b7400310515f793 | |
parent | b615272fa6dc79bd23eba5fe889733773076779d (diff) |
*** empty log message ***
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | hurd/=pending-changes | 3 | ||||
-rw-r--r-- | nfs/ChangeLog | 11 | ||||
-rw-r--r-- | nfs/ops.c | 33 | ||||
-rw-r--r-- | nfsd/ChangeLog | 8 | ||||
-rw-r--r-- | nfsd/ops.c | 11 |
6 files changed, 66 insertions, 2 deletions
@@ -17,6 +17,7 @@ See `tasks', the exported task list. * Profile things * Make for easier installation * Write coding standards suggestions for Hurd +* Implement file_fetch_dir * Fix emacs/src/unexelf.c to deal with occasional lack of mmap @@ -93,6 +94,7 @@ See `tasks', the exported task list. *** fsys_get_options should return the disk name. *** Add `author_tracks_uid' flag to struct node, and use it in places that modify author/uid. Initialized to 0. +*** Use idvecs. ** libfshelp *** Put functions here to deal with directory and file change notifications? diff --git a/hurd/=pending-changes b/hurd/=pending-changes index df3efdcf..a885c42f 100644 --- a/hurd/=pending-changes +++ b/hurd/=pending-changes @@ -20,6 +20,9 @@ Add io_revoke. Add optional timeout arg to msg.defs. +Add file_fetch_dir. + + Not user visible: diff --git a/nfs/ChangeLog b/nfs/ChangeLog index 23d5ba38..ee69f4ef 100644 --- a/nfs/ChangeLog +++ b/nfs/ChangeLog @@ -1,3 +1,14 @@ +Tue Aug 13 14:57:03 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * ops.c (netfs_attempt_create_file): Sun's NFS client does not + expect NFSPROC_CREATE to be exclusive. Accordingly, on most + servers (including ours) it isn't exclusive. (Which, of course, + contradicts Sun's own RGC 1094, section 2.2.10.) Which means we + have to insert our own test here to make sure the file doesn't + exist before attempting NFSPROC_CREATE. + (netfs_attempt_link): Likewise. + (verify_nonexistent): New function. + Mon Aug 12 11:13:58 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * nfs.c (nfs_error_trans): Repair syntax. @@ -409,6 +409,30 @@ netfs_attempt_write (struct netcred *cred, struct node *np, return 0; } +/* See if NAME exists in DIR for CRED. If so, return EEXIST. */ +error_t +verify_nonexistent (struct netcred *cred, struct node *dir, + char *name) +{ + int *p; + void *rpcbuf; + error_t err; + + p = nfs_initialize_rpc (NFSPROC_LOOKUP, cred, 0, &rpcbuf, dir, -1); + p = xdr_encode_fhandle (p, &dir->nn->handle); + p = xdr_encode_string (p, name); + + mutex_lock (&dir->lock); + err = conduct_rpc (&rpcbuf, &p); + if (!err) + err = nfs_error_trans (ntohl (*p++)); + + if (!err) + return EEXIST; + else + return 0; +} + /* Implement the netfs_attempt_lookup callback as described in <hurd/netfs.h>. */ error_t @@ -594,6 +618,11 @@ netfs_attempt_link (struct netcred *cred, struct node *dir, case BLKDEV: case FIFO: case SOCK: + + err = verify_nonexistent (cred, dir, name); + if (err) + return err; + mutex_lock (&dir->lock); p = nfs_initialize_rpc (NFSPROC_CREATE, cred, 0, &rpcbuf, dir, -1); p = xdr_encode_fhandle (p, &dir->nn->handle); @@ -704,6 +733,10 @@ netfs_attempt_create_file (struct netcred *cred, struct node *np, void *rpcbuf; error_t err; + err = verify_nonexistent (cred, np, name); + if (err) + return err; + p = nfs_initialize_rpc (NFSPROC_CREATE, cred, 0, &rpcbuf, np, -1); p = xdr_encode_fhandle (p, &np->nn->handle); p = xdr_encode_string (p, name); diff --git a/nfsd/ChangeLog b/nfsd/ChangeLog index 6edf4199..3fc876e2 100644 --- a/nfsd/ChangeLog +++ b/nfsd/ChangeLog @@ -1,3 +1,11 @@ +Tue Aug 13 14:38:36 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * ops.c (op_create): Sun's NFS client implementation actually + bombs if do do what RFC 1094 says to do in section 2.2.10. So + don't pass O_EXCL, but do pass O_TRUNC. That's what NetBSD does. + + * ops.c (op_setattr): Fill in an fattr in reply. + Mon Aug 12 11:15:15 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * Makefile (installationdir): Include quotes in variable expansion @@ -120,14 +120,21 @@ op_setattr (struct cache_handle *c, { error_t err = 0; mode_t mode; + struct stat st; mode = ntohl (*p++); if (mode != -1) err = file_chmod (c->port, mode); + + if (!err) + err = complete_setattr (c->port, p); + if (!err) + err = io_stat (c->port, &st); if (err) return err; - return complete_setattr (c->port, p); + *reply = encode_fattr (*reply, &st); + return 0; } static error_t @@ -290,7 +297,7 @@ op_create (struct cache_handle *c, p = decode_name (p, &name); mode = ntohl (*p++); - err = dir_lookup (c->port, name, O_NOTRANS | O_CREAT | O_EXCL, mode, + err = dir_lookup (c->port, name, O_NOTRANS | O_CREAT | O_TRUNC, mode, &do_retry, retry_name, &newport); if (!err && (do_retry != FS_RETRY_NORMAL |