diff options
Diffstat (limited to 'fs/nfs')
| -rw-r--r-- | fs/nfs/dir.c | 5 | ||||
| -rw-r--r-- | fs/nfs/nfs3acl.c | 34 | ||||
| -rw-r--r-- | fs/nfs/nfs4client.c | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs4proc.c | 8 | ||||
| -rw-r--r-- | fs/nfs/nfs4session.c | 25 | ||||
| -rw-r--r-- | fs/nfs/nfs4session.h | 2 |
6 files changed, 43 insertions, 33 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index be38b573495a..4a48fe4b84b6 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
| @@ -1846,6 +1846,11 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) | |||
| 1846 | GFP_KERNEL)) { | 1846 | GFP_KERNEL)) { |
| 1847 | SetPageUptodate(page); | 1847 | SetPageUptodate(page); |
| 1848 | unlock_page(page); | 1848 | unlock_page(page); |
| 1849 | /* | ||
| 1850 | * add_to_page_cache_lru() grabs an extra page refcount. | ||
| 1851 | * Drop it here to avoid leaking this page later. | ||
| 1852 | */ | ||
| 1853 | page_cache_release(page); | ||
| 1849 | } else | 1854 | } else |
| 1850 | __free_page(page); | 1855 | __free_page(page); |
| 1851 | 1856 | ||
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 9a5ca03fa539..871d6eda8dba 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
| @@ -80,7 +80,7 @@ struct posix_acl *nfs3_get_acl(struct inode *inode, int type) | |||
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | if (res.acl_access != NULL) { | 82 | if (res.acl_access != NULL) { |
| 83 | if (posix_acl_equiv_mode(res.acl_access, NULL) || | 83 | if ((posix_acl_equiv_mode(res.acl_access, NULL) == 0) || |
| 84 | res.acl_access->a_count == 0) { | 84 | res.acl_access->a_count == 0) { |
| 85 | posix_acl_release(res.acl_access); | 85 | posix_acl_release(res.acl_access); |
| 86 | res.acl_access = NULL; | 86 | res.acl_access = NULL; |
| @@ -113,7 +113,7 @@ getout: | |||
| 113 | return ERR_PTR(status); | 113 | return ERR_PTR(status); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | 116 | static int __nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, |
| 117 | struct posix_acl *dfacl) | 117 | struct posix_acl *dfacl) |
| 118 | { | 118 | { |
| 119 | struct nfs_server *server = NFS_SERVER(inode); | 119 | struct nfs_server *server = NFS_SERVER(inode); |
| @@ -198,6 +198,15 @@ out: | |||
| 198 | return status; | 198 | return status; |
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | ||
| 202 | struct posix_acl *dfacl) | ||
| 203 | { | ||
| 204 | int ret; | ||
| 205 | ret = __nfs3_proc_setacls(inode, acl, dfacl); | ||
| 206 | return (ret == -EOPNOTSUPP) ? 0 : ret; | ||
| 207 | |||
| 208 | } | ||
| 209 | |||
| 201 | int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type) | 210 | int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type) |
| 202 | { | 211 | { |
| 203 | struct posix_acl *alloc = NULL, *dfacl = NULL; | 212 | struct posix_acl *alloc = NULL, *dfacl = NULL; |
| @@ -225,7 +234,7 @@ int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
| 225 | if (IS_ERR(alloc)) | 234 | if (IS_ERR(alloc)) |
| 226 | goto fail; | 235 | goto fail; |
| 227 | } | 236 | } |
| 228 | status = nfs3_proc_setacls(inode, acl, dfacl); | 237 | status = __nfs3_proc_setacls(inode, acl, dfacl); |
| 229 | posix_acl_release(alloc); | 238 | posix_acl_release(alloc); |
| 230 | return status; | 239 | return status; |
| 231 | 240 | ||
| @@ -233,25 +242,6 @@ fail: | |||
| 233 | return PTR_ERR(alloc); | 242 | return PTR_ERR(alloc); |
| 234 | } | 243 | } |
| 235 | 244 | ||
| 236 | int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, | ||
| 237 | umode_t mode) | ||
| 238 | { | ||
| 239 | struct posix_acl *default_acl, *acl; | ||
| 240 | int error; | ||
| 241 | |||
| 242 | error = posix_acl_create(dir, &mode, &default_acl, &acl); | ||
| 243 | if (error) | ||
| 244 | return (error == -EOPNOTSUPP) ? 0 : error; | ||
| 245 | |||
| 246 | error = nfs3_proc_setacls(inode, acl, default_acl); | ||
| 247 | |||
| 248 | if (acl) | ||
| 249 | posix_acl_release(acl); | ||
| 250 | if (default_acl) | ||
| 251 | posix_acl_release(default_acl); | ||
| 252 | return error; | ||
| 253 | } | ||
| 254 | |||
| 255 | const struct xattr_handler *nfs3_xattr_handlers[] = { | 245 | const struct xattr_handler *nfs3_xattr_handlers[] = { |
| 256 | &posix_acl_access_xattr_handler, | 246 | &posix_acl_access_xattr_handler, |
| 257 | &posix_acl_default_xattr_handler, | 247 | &posix_acl_default_xattr_handler, |
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index dbb3e1f30c68..860ad26a5590 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
| @@ -170,7 +170,7 @@ void nfs41_shutdown_client(struct nfs_client *clp) | |||
| 170 | void nfs40_shutdown_client(struct nfs_client *clp) | 170 | void nfs40_shutdown_client(struct nfs_client *clp) |
| 171 | { | 171 | { |
| 172 | if (clp->cl_slot_tbl) { | 172 | if (clp->cl_slot_tbl) { |
| 173 | nfs4_release_slot_table(clp->cl_slot_tbl); | 173 | nfs4_shutdown_slot_table(clp->cl_slot_tbl); |
| 174 | kfree(clp->cl_slot_tbl); | 174 | kfree(clp->cl_slot_tbl); |
| 175 | } | 175 | } |
| 176 | } | 176 | } |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 42da6af77587..2da6a698b8f7 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -1620,15 +1620,15 @@ static void nfs4_open_confirm_prepare(struct rpc_task *task, void *calldata) | |||
| 1620 | { | 1620 | { |
| 1621 | struct nfs4_opendata *data = calldata; | 1621 | struct nfs4_opendata *data = calldata; |
| 1622 | 1622 | ||
| 1623 | nfs40_setup_sequence(data->o_arg.server, &data->o_arg.seq_args, | 1623 | nfs40_setup_sequence(data->o_arg.server, &data->c_arg.seq_args, |
| 1624 | &data->o_res.seq_res, task); | 1624 | &data->c_res.seq_res, task); |
| 1625 | } | 1625 | } |
| 1626 | 1626 | ||
| 1627 | static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata) | 1627 | static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata) |
| 1628 | { | 1628 | { |
| 1629 | struct nfs4_opendata *data = calldata; | 1629 | struct nfs4_opendata *data = calldata; |
| 1630 | 1630 | ||
| 1631 | nfs40_sequence_done(task, &data->o_res.seq_res); | 1631 | nfs40_sequence_done(task, &data->c_res.seq_res); |
| 1632 | 1632 | ||
| 1633 | data->rpc_status = task->tk_status; | 1633 | data->rpc_status = task->tk_status; |
| 1634 | if (data->rpc_status == 0) { | 1634 | if (data->rpc_status == 0) { |
| @@ -1686,7 +1686,7 @@ static int _nfs4_proc_open_confirm(struct nfs4_opendata *data) | |||
| 1686 | }; | 1686 | }; |
| 1687 | int status; | 1687 | int status; |
| 1688 | 1688 | ||
| 1689 | nfs4_init_sequence(&data->o_arg.seq_args, &data->o_res.seq_res, 1); | 1689 | nfs4_init_sequence(&data->c_arg.seq_args, &data->c_res.seq_res, 1); |
| 1690 | kref_get(&data->kref); | 1690 | kref_get(&data->kref); |
| 1691 | data->rpc_done = 0; | 1691 | data->rpc_done = 0; |
| 1692 | data->rpc_status = 0; | 1692 | data->rpc_status = 0; |
diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c index cf883c7ae053..e799dc3c3b1d 100644 --- a/fs/nfs/nfs4session.c +++ b/fs/nfs/nfs4session.c | |||
| @@ -231,14 +231,23 @@ out: | |||
| 231 | return ret; | 231 | return ret; |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | /* | ||
| 235 | * nfs4_release_slot_table - release all slot table entries | ||
| 236 | */ | ||
| 237 | static void nfs4_release_slot_table(struct nfs4_slot_table *tbl) | ||
| 238 | { | ||
| 239 | nfs4_shrink_slot_table(tbl, 0); | ||
| 240 | } | ||
| 241 | |||
| 234 | /** | 242 | /** |
| 235 | * nfs4_release_slot_table - release resources attached to a slot table | 243 | * nfs4_shutdown_slot_table - release resources attached to a slot table |
| 236 | * @tbl: slot table to shut down | 244 | * @tbl: slot table to shut down |
| 237 | * | 245 | * |
| 238 | */ | 246 | */ |
| 239 | void nfs4_release_slot_table(struct nfs4_slot_table *tbl) | 247 | void nfs4_shutdown_slot_table(struct nfs4_slot_table *tbl) |
| 240 | { | 248 | { |
| 241 | nfs4_shrink_slot_table(tbl, 0); | 249 | nfs4_release_slot_table(tbl); |
| 250 | rpc_destroy_wait_queue(&tbl->slot_tbl_waitq); | ||
| 242 | } | 251 | } |
| 243 | 252 | ||
| 244 | /** | 253 | /** |
| @@ -422,7 +431,7 @@ void nfs41_update_target_slotid(struct nfs4_slot_table *tbl, | |||
| 422 | spin_unlock(&tbl->slot_tbl_lock); | 431 | spin_unlock(&tbl->slot_tbl_lock); |
| 423 | } | 432 | } |
| 424 | 433 | ||
| 425 | static void nfs4_destroy_session_slot_tables(struct nfs4_session *session) | 434 | static void nfs4_release_session_slot_tables(struct nfs4_session *session) |
| 426 | { | 435 | { |
| 427 | nfs4_release_slot_table(&session->fc_slot_table); | 436 | nfs4_release_slot_table(&session->fc_slot_table); |
| 428 | nfs4_release_slot_table(&session->bc_slot_table); | 437 | nfs4_release_slot_table(&session->bc_slot_table); |
| @@ -450,7 +459,7 @@ int nfs4_setup_session_slot_tables(struct nfs4_session *ses) | |||
| 450 | if (status && tbl->slots == NULL) | 459 | if (status && tbl->slots == NULL) |
| 451 | /* Fore and back channel share a connection so get | 460 | /* Fore and back channel share a connection so get |
| 452 | * both slot tables or neither */ | 461 | * both slot tables or neither */ |
| 453 | nfs4_destroy_session_slot_tables(ses); | 462 | nfs4_release_session_slot_tables(ses); |
| 454 | return status; | 463 | return status; |
| 455 | } | 464 | } |
| 456 | 465 | ||
| @@ -470,6 +479,12 @@ struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp) | |||
| 470 | return session; | 479 | return session; |
| 471 | } | 480 | } |
| 472 | 481 | ||
| 482 | static void nfs4_destroy_session_slot_tables(struct nfs4_session *session) | ||
| 483 | { | ||
| 484 | nfs4_shutdown_slot_table(&session->fc_slot_table); | ||
| 485 | nfs4_shutdown_slot_table(&session->bc_slot_table); | ||
| 486 | } | ||
| 487 | |||
| 473 | void nfs4_destroy_session(struct nfs4_session *session) | 488 | void nfs4_destroy_session(struct nfs4_session *session) |
| 474 | { | 489 | { |
| 475 | struct rpc_xprt *xprt; | 490 | struct rpc_xprt *xprt; |
diff --git a/fs/nfs/nfs4session.h b/fs/nfs/nfs4session.h index 232306100651..b34ada9bc6a2 100644 --- a/fs/nfs/nfs4session.h +++ b/fs/nfs/nfs4session.h | |||
| @@ -74,7 +74,7 @@ enum nfs4_session_state { | |||
| 74 | 74 | ||
| 75 | extern int nfs4_setup_slot_table(struct nfs4_slot_table *tbl, | 75 | extern int nfs4_setup_slot_table(struct nfs4_slot_table *tbl, |
| 76 | unsigned int max_reqs, const char *queue); | 76 | unsigned int max_reqs, const char *queue); |
| 77 | extern void nfs4_release_slot_table(struct nfs4_slot_table *tbl); | 77 | extern void nfs4_shutdown_slot_table(struct nfs4_slot_table *tbl); |
| 78 | extern struct nfs4_slot *nfs4_alloc_slot(struct nfs4_slot_table *tbl); | 78 | extern struct nfs4_slot *nfs4_alloc_slot(struct nfs4_slot_table *tbl); |
| 79 | extern void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot); | 79 | extern void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot); |
| 80 | extern void nfs4_slot_tbl_drain_complete(struct nfs4_slot_table *tbl); | 80 | extern void nfs4_slot_tbl_drain_complete(struct nfs4_slot_table *tbl); |
