Commit 2a852fd1 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'afs-fixes-20190413' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs

Pull AFS fixes from David Howells:

 - Stop using the deprecated get_seconds().

 - Don't make tracepoint strings const as the section they go in isn't
   read-only.

 - Differentiate failure due to unmarshalling from other failure cases.
   We shouldn't abort with RXGEN_CC/SS_UNMARSHAL if it's not due to
   unmarshalling.

 - Add a missing unlock_page().

 - Fix the interaction between receiving a notification from a server
   that it has invalidated all outstanding callback promises and a
   client call that we're in the middle of making that will get a new
   promise.

* tag 'afs-fixes-20190413' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
  afs: Fix in-progess ops to ignore server-level callback invalidation
  afs: Unlock pages for __pagevec_release()
  afs: Differentiate abort due to unmarshalling from other errors
  afs: Avoid section confusion in CM_NAME
  afs: avoid deprecated get_seconds()
parents d3ce3b18 eeba1e9c
...@@ -203,8 +203,7 @@ void afs_put_cb_interest(struct afs_net *net, struct afs_cb_interest *cbi) ...@@ -203,8 +203,7 @@ void afs_put_cb_interest(struct afs_net *net, struct afs_cb_interest *cbi)
*/ */
void afs_init_callback_state(struct afs_server *server) void afs_init_callback_state(struct afs_server *server)
{ {
if (!test_and_clear_bit(AFS_SERVER_FL_NEW, &server->flags)) server->cb_s_break++;
server->cb_s_break++;
} }
/* /*
......
...@@ -34,7 +34,7 @@ static void SRXAFSCB_TellMeAboutYourself(struct work_struct *); ...@@ -34,7 +34,7 @@ static void SRXAFSCB_TellMeAboutYourself(struct work_struct *);
static int afs_deliver_yfs_cb_callback(struct afs_call *); static int afs_deliver_yfs_cb_callback(struct afs_call *);
#define CM_NAME(name) \ #define CM_NAME(name) \
const char afs_SRXCB##name##_name[] __tracepoint_string = \ char afs_SRXCB##name##_name[] __tracepoint_string = \
"CB." #name "CB." #name
/* /*
......
...@@ -216,9 +216,7 @@ struct inode *afs_iget_pseudo_dir(struct super_block *sb, bool root) ...@@ -216,9 +216,7 @@ struct inode *afs_iget_pseudo_dir(struct super_block *sb, bool root)
set_nlink(inode, 2); set_nlink(inode, 2);
inode->i_uid = GLOBAL_ROOT_UID; inode->i_uid = GLOBAL_ROOT_UID;
inode->i_gid = GLOBAL_ROOT_GID; inode->i_gid = GLOBAL_ROOT_GID;
inode->i_ctime.tv_sec = get_seconds(); inode->i_ctime = inode->i_atime = inode->i_mtime = current_time(inode);
inode->i_ctime.tv_nsec = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime;
inode->i_blocks = 0; inode->i_blocks = 0;
inode_set_iversion_raw(inode, 0); inode_set_iversion_raw(inode, 0);
inode->i_generation = 0; inode->i_generation = 0;
......
...@@ -474,7 +474,6 @@ struct afs_server { ...@@ -474,7 +474,6 @@ struct afs_server {
time64_t put_time; /* Time at which last put */ time64_t put_time; /* Time at which last put */
time64_t update_at; /* Time at which to next update the record */ time64_t update_at; /* Time at which to next update the record */
unsigned long flags; unsigned long flags;
#define AFS_SERVER_FL_NEW 0 /* New server, don't inc cb_s_break */
#define AFS_SERVER_FL_NOT_READY 1 /* The record is not ready for use */ #define AFS_SERVER_FL_NOT_READY 1 /* The record is not ready for use */
#define AFS_SERVER_FL_NOT_FOUND 2 /* VL server says no such server */ #define AFS_SERVER_FL_NOT_FOUND 2 /* VL server says no such server */
#define AFS_SERVER_FL_VL_FAIL 3 /* Failed to access VL server */ #define AFS_SERVER_FL_VL_FAIL 3 /* Failed to access VL server */
...@@ -827,7 +826,7 @@ static inline struct afs_cb_interest *afs_get_cb_interest(struct afs_cb_interest ...@@ -827,7 +826,7 @@ static inline struct afs_cb_interest *afs_get_cb_interest(struct afs_cb_interest
static inline unsigned int afs_calc_vnode_cb_break(struct afs_vnode *vnode) static inline unsigned int afs_calc_vnode_cb_break(struct afs_vnode *vnode)
{ {
return vnode->cb_break + vnode->cb_s_break + vnode->cb_v_break; return vnode->cb_break + vnode->cb_v_break;
} }
static inline bool afs_cb_is_broken(unsigned int cb_break, static inline bool afs_cb_is_broken(unsigned int cb_break,
...@@ -835,7 +834,6 @@ static inline bool afs_cb_is_broken(unsigned int cb_break, ...@@ -835,7 +834,6 @@ static inline bool afs_cb_is_broken(unsigned int cb_break,
const struct afs_cb_interest *cbi) const struct afs_cb_interest *cbi)
{ {
return !cbi || cb_break != (vnode->cb_break + return !cbi || cb_break != (vnode->cb_break +
cbi->server->cb_s_break +
vnode->volume->cb_v_break); vnode->volume->cb_v_break);
} }
......
...@@ -572,13 +572,17 @@ static void afs_deliver_to_call(struct afs_call *call) ...@@ -572,13 +572,17 @@ static void afs_deliver_to_call(struct afs_call *call)
case -ENODATA: case -ENODATA:
case -EBADMSG: case -EBADMSG:
case -EMSGSIZE: case -EMSGSIZE:
default:
abort_code = RXGEN_CC_UNMARSHAL; abort_code = RXGEN_CC_UNMARSHAL;
if (state != AFS_CALL_CL_AWAIT_REPLY) if (state != AFS_CALL_CL_AWAIT_REPLY)
abort_code = RXGEN_SS_UNMARSHAL; abort_code = RXGEN_SS_UNMARSHAL;
rxrpc_kernel_abort_call(call->net->socket, call->rxcall, rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
abort_code, ret, "KUM"); abort_code, ret, "KUM");
goto local_abort; goto local_abort;
default:
abort_code = RX_USER_ABORT;
rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
abort_code, ret, "KER");
goto local_abort;
} }
} }
......
...@@ -226,7 +226,6 @@ static struct afs_server *afs_alloc_server(struct afs_net *net, ...@@ -226,7 +226,6 @@ static struct afs_server *afs_alloc_server(struct afs_net *net,
RCU_INIT_POINTER(server->addresses, alist); RCU_INIT_POINTER(server->addresses, alist);
server->addr_version = alist->version; server->addr_version = alist->version;
server->uuid = *uuid; server->uuid = *uuid;
server->flags = (1UL << AFS_SERVER_FL_NEW);
server->update_at = ktime_get_real_seconds() + afs_server_update_delay; server->update_at = ktime_get_real_seconds() + afs_server_update_delay;
rwlock_init(&server->fs_lock); rwlock_init(&server->fs_lock);
INIT_HLIST_HEAD(&server->cb_volumes); INIT_HLIST_HEAD(&server->cb_volumes);
......
...@@ -264,6 +264,7 @@ static void afs_kill_pages(struct address_space *mapping, ...@@ -264,6 +264,7 @@ static void afs_kill_pages(struct address_space *mapping,
first = page->index + 1; first = page->index + 1;
lock_page(page); lock_page(page);
generic_error_remove_page(mapping, page); generic_error_remove_page(mapping, page);
unlock_page(page);
} }
__pagevec_release(&pv); __pagevec_release(&pv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment