aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/bio-integrity.c5
-rw-r--r--fs/hfsplus/options.c2
-rw-r--r--fs/nfs/delegation.c11
-rw-r--r--fs/nfs/nfs4filelayout.c10
-rw-r--r--fs/nfs/nfs4proc.c24
-rw-r--r--fs/nfs/nfs4state.c14
-rw-r--r--fs/ocfs2/quota_global.c27
-rw-r--r--fs/ocfs2/quota_local.c4
-rw-r--r--fs/proc/page.c5
9 files changed, 51 insertions, 51 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 0129b78a6908..4f70f383132c 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -458,11 +458,10 @@ static int bio_integrity_verify(struct bio *bio)
458 struct blk_integrity_exchg bix; 458 struct blk_integrity_exchg bix;
459 struct bio_vec *bv; 459 struct bio_vec *bv;
460 sector_t sector = bio->bi_integrity->bip_iter.bi_sector; 460 sector_t sector = bio->bi_integrity->bip_iter.bi_sector;
461 unsigned int sectors, total, ret; 461 unsigned int sectors, ret = 0;
462 void *prot_buf = bio->bi_integrity->bip_buf; 462 void *prot_buf = bio->bi_integrity->bip_buf;
463 int i; 463 int i;
464 464
465 ret = total = 0;
466 bix.disk_name = bio->bi_bdev->bd_disk->disk_name; 465 bix.disk_name = bio->bi_bdev->bd_disk->disk_name;
467 bix.sector_size = bi->sector_size; 466 bix.sector_size = bi->sector_size;
468 467
@@ -484,8 +483,6 @@ static int bio_integrity_verify(struct bio *bio)
484 sectors = bv->bv_len / bi->sector_size; 483 sectors = bv->bv_len / bi->sector_size;
485 sector += sectors; 484 sector += sectors;
486 prot_buf += sectors * bi->tuple_size; 485 prot_buf += sectors * bi->tuple_size;
487 total += sectors * bi->tuple_size;
488 BUG_ON(total > bio->bi_integrity->bip_iter.bi_size);
489 486
490 kunmap_atomic(kaddr); 487 kunmap_atomic(kaddr);
491 } 488 }
diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c
index 968eab5bc1f5..68537e8b7a09 100644
--- a/fs/hfsplus/options.c
+++ b/fs/hfsplus/options.c
@@ -75,7 +75,7 @@ int hfsplus_parse_options_remount(char *input, int *force)
75 int token; 75 int token;
76 76
77 if (!input) 77 if (!input)
78 return 0; 78 return 1;
79 79
80 while ((p = strsep(&input, ",")) != NULL) { 80 while ((p = strsep(&input, ",")) != NULL) {
81 if (!*p) 81 if (!*p)
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index ef792f29f831..5d8ccecf5f5c 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -659,16 +659,19 @@ int nfs_async_inode_return_delegation(struct inode *inode,
659 659
660 rcu_read_lock(); 660 rcu_read_lock();
661 delegation = rcu_dereference(NFS_I(inode)->delegation); 661 delegation = rcu_dereference(NFS_I(inode)->delegation);
662 if (delegation == NULL)
663 goto out_enoent;
662 664
663 if (!clp->cl_mvops->match_stateid(&delegation->stateid, stateid)) { 665 if (!clp->cl_mvops->match_stateid(&delegation->stateid, stateid))
664 rcu_read_unlock(); 666 goto out_enoent;
665 return -ENOENT;
666 }
667 nfs_mark_return_delegation(server, delegation); 667 nfs_mark_return_delegation(server, delegation);
668 rcu_read_unlock(); 668 rcu_read_unlock();
669 669
670 nfs_delegation_run_state_manager(clp); 670 nfs_delegation_run_state_manager(clp);
671 return 0; 671 return 0;
672out_enoent:
673 rcu_read_unlock();
674 return -ENOENT;
672} 675}
673 676
674static struct inode * 677static struct inode *
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 12c8132ad408..b9a35c05b60f 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -324,8 +324,9 @@ static void filelayout_read_prepare(struct rpc_task *task, void *data)
324 &rdata->res.seq_res, 324 &rdata->res.seq_res,
325 task)) 325 task))
326 return; 326 return;
327 nfs4_set_rw_stateid(&rdata->args.stateid, rdata->args.context, 327 if (nfs4_set_rw_stateid(&rdata->args.stateid, rdata->args.context,
328 rdata->args.lock_context, FMODE_READ); 328 rdata->args.lock_context, FMODE_READ) == -EIO)
329 rpc_exit(task, -EIO); /* lost lock, terminate I/O */
329} 330}
330 331
331static void filelayout_read_call_done(struct rpc_task *task, void *data) 332static void filelayout_read_call_done(struct rpc_task *task, void *data)
@@ -435,8 +436,9 @@ static void filelayout_write_prepare(struct rpc_task *task, void *data)
435 &wdata->res.seq_res, 436 &wdata->res.seq_res,
436 task)) 437 task))
437 return; 438 return;
438 nfs4_set_rw_stateid(&wdata->args.stateid, wdata->args.context, 439 if (nfs4_set_rw_stateid(&wdata->args.stateid, wdata->args.context,
439 wdata->args.lock_context, FMODE_WRITE); 440 wdata->args.lock_context, FMODE_WRITE) == -EIO)
441 rpc_exit(task, -EIO); /* lost lock, terminate I/O */
440} 442}
441 443
442static void filelayout_write_call_done(struct rpc_task *task, void *data) 444static void filelayout_write_call_done(struct rpc_task *task, void *data)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 2da6a698b8f7..450bfedbe2f4 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2398,13 +2398,16 @@ static int _nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
2398 2398
2399 if (nfs4_copy_delegation_stateid(&arg.stateid, inode, fmode)) { 2399 if (nfs4_copy_delegation_stateid(&arg.stateid, inode, fmode)) {
2400 /* Use that stateid */ 2400 /* Use that stateid */
2401 } else if (truncate && state != NULL && nfs4_valid_open_stateid(state)) { 2401 } else if (truncate && state != NULL) {
2402 struct nfs_lockowner lockowner = { 2402 struct nfs_lockowner lockowner = {
2403 .l_owner = current->files, 2403 .l_owner = current->files,
2404 .l_pid = current->tgid, 2404 .l_pid = current->tgid,
2405 }; 2405 };
2406 nfs4_select_rw_stateid(&arg.stateid, state, FMODE_WRITE, 2406 if (!nfs4_valid_open_stateid(state))
2407 &lockowner); 2407 return -EBADF;
2408 if (nfs4_select_rw_stateid(&arg.stateid, state, FMODE_WRITE,
2409 &lockowner) == -EIO)
2410 return -EBADF;
2408 } else 2411 } else
2409 nfs4_stateid_copy(&arg.stateid, &zero_stateid); 2412 nfs4_stateid_copy(&arg.stateid, &zero_stateid);
2410 2413
@@ -4011,8 +4014,9 @@ static bool nfs4_stateid_is_current(nfs4_stateid *stateid,
4011{ 4014{
4012 nfs4_stateid current_stateid; 4015 nfs4_stateid current_stateid;
4013 4016
4014 if (nfs4_set_rw_stateid(&current_stateid, ctx, l_ctx, fmode)) 4017 /* If the current stateid represents a lost lock, then exit */
4015 return false; 4018 if (nfs4_set_rw_stateid(&current_stateid, ctx, l_ctx, fmode) == -EIO)
4019 return true;
4016 return nfs4_stateid_match(stateid, &current_stateid); 4020 return nfs4_stateid_match(stateid, &current_stateid);
4017} 4021}
4018 4022
@@ -5828,8 +5832,7 @@ struct nfs_release_lockowner_data {
5828 struct nfs4_lock_state *lsp; 5832 struct nfs4_lock_state *lsp;
5829 struct nfs_server *server; 5833 struct nfs_server *server;
5830 struct nfs_release_lockowner_args args; 5834 struct nfs_release_lockowner_args args;
5831 struct nfs4_sequence_args seq_args; 5835 struct nfs_release_lockowner_res res;
5832 struct nfs4_sequence_res seq_res;
5833 unsigned long timestamp; 5836 unsigned long timestamp;
5834}; 5837};
5835 5838
@@ -5837,7 +5840,7 @@ static void nfs4_release_lockowner_prepare(struct rpc_task *task, void *calldata
5837{ 5840{
5838 struct nfs_release_lockowner_data *data = calldata; 5841 struct nfs_release_lockowner_data *data = calldata;
5839 nfs40_setup_sequence(data->server, 5842 nfs40_setup_sequence(data->server,
5840 &data->seq_args, &data->seq_res, task); 5843 &data->args.seq_args, &data->res.seq_res, task);
5841 data->timestamp = jiffies; 5844 data->timestamp = jiffies;
5842} 5845}
5843 5846
@@ -5846,7 +5849,7 @@ static void nfs4_release_lockowner_done(struct rpc_task *task, void *calldata)
5846 struct nfs_release_lockowner_data *data = calldata; 5849 struct nfs_release_lockowner_data *data = calldata;
5847 struct nfs_server *server = data->server; 5850 struct nfs_server *server = data->server;
5848 5851
5849 nfs40_sequence_done(task, &data->seq_res); 5852 nfs40_sequence_done(task, &data->res.seq_res);
5850 5853
5851 switch (task->tk_status) { 5854 switch (task->tk_status) {
5852 case 0: 5855 case 0:
@@ -5887,7 +5890,6 @@ static int nfs4_release_lockowner(struct nfs_server *server, struct nfs4_lock_st
5887 data = kmalloc(sizeof(*data), GFP_NOFS); 5890 data = kmalloc(sizeof(*data), GFP_NOFS);
5888 if (!data) 5891 if (!data)
5889 return -ENOMEM; 5892 return -ENOMEM;
5890 nfs4_init_sequence(&data->seq_args, &data->seq_res, 0);
5891 data->lsp = lsp; 5893 data->lsp = lsp;
5892 data->server = server; 5894 data->server = server;
5893 data->args.lock_owner.clientid = server->nfs_client->cl_clientid; 5895 data->args.lock_owner.clientid = server->nfs_client->cl_clientid;
@@ -5895,6 +5897,8 @@ static int nfs4_release_lockowner(struct nfs_server *server, struct nfs4_lock_st
5895 data->args.lock_owner.s_dev = server->s_dev; 5897 data->args.lock_owner.s_dev = server->s_dev;
5896 5898
5897 msg.rpc_argp = &data->args; 5899 msg.rpc_argp = &data->args;
5900 msg.rpc_resp = &data->res;
5901 nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 0);
5898 rpc_call_async(server->client, &msg, 0, &nfs4_release_lockowner_ops, data); 5902 rpc_call_async(server->client, &msg, 0, &nfs4_release_lockowner_ops, data);
5899 return 0; 5903 return 0;
5900} 5904}
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index e1a47217c05e..0deb32105ccf 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -974,9 +974,6 @@ static int nfs4_copy_lock_stateid(nfs4_stateid *dst,
974 else if (lsp != NULL && test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags) != 0) { 974 else if (lsp != NULL && test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags) != 0) {
975 nfs4_stateid_copy(dst, &lsp->ls_stateid); 975 nfs4_stateid_copy(dst, &lsp->ls_stateid);
976 ret = 0; 976 ret = 0;
977 smp_rmb();
978 if (!list_empty(&lsp->ls_seqid.list))
979 ret = -EWOULDBLOCK;
980 } 977 }
981 spin_unlock(&state->state_lock); 978 spin_unlock(&state->state_lock);
982 nfs4_put_lock_state(lsp); 979 nfs4_put_lock_state(lsp);
@@ -984,10 +981,9 @@ out:
984 return ret; 981 return ret;
985} 982}
986 983
987static int nfs4_copy_open_stateid(nfs4_stateid *dst, struct nfs4_state *state) 984static void nfs4_copy_open_stateid(nfs4_stateid *dst, struct nfs4_state *state)
988{ 985{
989 const nfs4_stateid *src; 986 const nfs4_stateid *src;
990 int ret;
991 int seq; 987 int seq;
992 988
993 do { 989 do {
@@ -996,12 +992,7 @@ static int nfs4_copy_open_stateid(nfs4_stateid *dst, struct nfs4_state *state)
996 if (test_bit(NFS_OPEN_STATE, &state->flags)) 992 if (test_bit(NFS_OPEN_STATE, &state->flags))
997 src = &state->open_stateid; 993 src = &state->open_stateid;
998 nfs4_stateid_copy(dst, src); 994 nfs4_stateid_copy(dst, src);
999 ret = 0;
1000 smp_rmb();
1001 if (!list_empty(&state->owner->so_seqid.list))
1002 ret = -EWOULDBLOCK;
1003 } while (read_seqretry(&state->seqlock, seq)); 995 } while (read_seqretry(&state->seqlock, seq));
1004 return ret;
1005} 996}
1006 997
1007/* 998/*
@@ -1026,7 +1017,8 @@ int nfs4_select_rw_stateid(nfs4_stateid *dst, struct nfs4_state *state,
1026 * choose to use. 1017 * choose to use.
1027 */ 1018 */
1028 goto out; 1019 goto out;
1029 ret = nfs4_copy_open_stateid(dst, state); 1020 nfs4_copy_open_stateid(dst, state);
1021 ret = 0;
1030out: 1022out:
1031 if (nfs_server_capable(state->inode, NFS_CAP_STATEID_NFSV41)) 1023 if (nfs_server_capable(state->inode, NFS_CAP_STATEID_NFSV41))
1032 dst->seqid = 0; 1024 dst->seqid = 0;
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index aaa50611ec66..d7b5108789e2 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -717,6 +717,12 @@ static int ocfs2_release_dquot(struct dquot *dquot)
717 */ 717 */
718 if (status < 0) 718 if (status < 0)
719 mlog_errno(status); 719 mlog_errno(status);
720 /*
721 * Clear dq_off so that we search for the structure in quota file next
722 * time we acquire it. The structure might be deleted and reallocated
723 * elsewhere by another node while our dquot structure is on freelist.
724 */
725 dquot->dq_off = 0;
720 clear_bit(DQ_ACTIVE_B, &dquot->dq_flags); 726 clear_bit(DQ_ACTIVE_B, &dquot->dq_flags);
721out_trans: 727out_trans:
722 ocfs2_commit_trans(osb, handle); 728 ocfs2_commit_trans(osb, handle);
@@ -756,16 +762,17 @@ static int ocfs2_acquire_dquot(struct dquot *dquot)
756 status = ocfs2_lock_global_qf(info, 1); 762 status = ocfs2_lock_global_qf(info, 1);
757 if (status < 0) 763 if (status < 0)
758 goto out; 764 goto out;
759 if (!test_bit(DQ_READ_B, &dquot->dq_flags)) { 765 status = ocfs2_qinfo_lock(info, 0);
760 status = ocfs2_qinfo_lock(info, 0); 766 if (status < 0)
761 if (status < 0) 767 goto out_dq;
762 goto out_dq; 768 /*
763 status = qtree_read_dquot(&info->dqi_gi, dquot); 769 * We always want to read dquot structure from disk because we don't
764 ocfs2_qinfo_unlock(info, 0); 770 * know what happened with it while it was on freelist.
765 if (status < 0) 771 */
766 goto out_dq; 772 status = qtree_read_dquot(&info->dqi_gi, dquot);
767 } 773 ocfs2_qinfo_unlock(info, 0);
768 set_bit(DQ_READ_B, &dquot->dq_flags); 774 if (status < 0)
775 goto out_dq;
769 776
770 OCFS2_DQUOT(dquot)->dq_use_count++; 777 OCFS2_DQUOT(dquot)->dq_use_count++;
771 OCFS2_DQUOT(dquot)->dq_origspace = dquot->dq_dqb.dqb_curspace; 778 OCFS2_DQUOT(dquot)->dq_origspace = dquot->dq_dqb.dqb_curspace;
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c
index 2e4344be3b96..2001862bf2b1 100644
--- a/fs/ocfs2/quota_local.c
+++ b/fs/ocfs2/quota_local.c
@@ -1303,10 +1303,6 @@ int ocfs2_local_release_dquot(handle_t *handle, struct dquot *dquot)
1303 ocfs2_journal_dirty(handle, od->dq_chunk->qc_headerbh); 1303 ocfs2_journal_dirty(handle, od->dq_chunk->qc_headerbh);
1304 1304
1305out: 1305out:
1306 /* Clear the read bit so that next time someone uses this
1307 * dquot he reads fresh info from disk and allocates local
1308 * dquot structure */
1309 clear_bit(DQ_READ_B, &dquot->dq_flags);
1310 return status; 1306 return status;
1311} 1307}
1312 1308
diff --git a/fs/proc/page.c b/fs/proc/page.c
index 02174a610315..e647c55275d9 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -121,9 +121,8 @@ u64 stable_page_flags(struct page *page)
121 * just checks PG_head/PG_tail, so we need to check PageLRU/PageAnon 121 * just checks PG_head/PG_tail, so we need to check PageLRU/PageAnon
122 * to make sure a given page is a thp, not a non-huge compound page. 122 * to make sure a given page is a thp, not a non-huge compound page.
123 */ 123 */
124 else if (PageTransCompound(page) && 124 else if (PageTransCompound(page) && (PageLRU(compound_head(page)) ||
125 (PageLRU(compound_trans_head(page)) || 125 PageAnon(compound_head(page))))
126 PageAnon(compound_trans_head(page))))
127 u |= 1 << KPF_THP; 126 u |= 1 << KPF_THP;
128 127
129 /* 128 /*