Skip to content

Commit 4964dd2

Browse files
committed
Merge tag 'afs-fixes-20200609' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
Pull AFS fixes from David Howells: "A set of small patches to fix some things, most of them minor. - Fix a memory leak in afs_put_sysnames() - Fix an oops in AFS file locking - Fix new use of BUG() - Fix debugging statements containing %px - Remove afs_zero_fid as it's unused - Make afs_zap_data() static" * tag 'afs-fixes-20200609' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Make afs_zap_data() static afs: Remove afs_zero_fid as it's not used afs: Fix debugging statements with %px to be %p afs: Fix use of BUG() afs: Fix file locking afs: Fix memory leak in afs_put_sysnames()
2 parents 42612e7 + c68421b commit 4964dd2

File tree

7 files changed

+7
-9
lines changed

7 files changed

+7
-9
lines changed

fs/afs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
980980
if (!IS_ERR_OR_NULL(inode))
981981
fid = AFS_FS_I(inode)->fid;
982982

983-
_debug("splice %px", dentry->d_inode);
983+
_debug("splice %p", dentry->d_inode);
984984
d = d_splice_alias(inode, dentry);
985985
if (!IS_ERR_OR_NULL(d)) {
986986
d->d_fsdata = dentry->d_fsdata;

fs/afs/flock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void afs_schedule_lock_extension(struct afs_vnode *vnode)
7171
void afs_lock_op_done(struct afs_call *call)
7272
{
7373
struct afs_operation *op = call->op;
74-
struct afs_vnode *vnode = op->lock.lvnode;
74+
struct afs_vnode *vnode = op->file[0].vnode;
7575

7676
if (call->error == 0) {
7777
spin_lock(&vnode->lock);

fs/afs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ struct inode *afs_root_iget(struct super_block *sb, struct key *key)
538538
* mark the data attached to an inode as obsolete due to a write on the server
539539
* - might also want to ditch all the outstanding writes and dirty pages
540540
*/
541-
void afs_zap_data(struct afs_vnode *vnode)
541+
static void afs_zap_data(struct afs_vnode *vnode)
542542
{
543543
_enter("{%llx:%llu}", vnode->fid.vid, vnode->fid.vnode);
544544

fs/afs/internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ struct afs_operation {
795795
struct afs_read *req;
796796
} fetch;
797797
struct {
798-
struct afs_vnode *lvnode; /* vnode being locked */
799798
afs_lock_type_t type;
800799
} lock;
801800
struct {
@@ -1070,7 +1069,6 @@ extern int afs_ilookup5_test_by_fid(struct inode *, void *);
10701069
extern struct inode *afs_iget_pseudo_dir(struct super_block *, bool);
10711070
extern struct inode *afs_iget(struct afs_operation *, struct afs_vnode_param *);
10721071
extern struct inode *afs_root_iget(struct super_block *, struct key *);
1073-
extern void afs_zap_data(struct afs_vnode *);
10741072
extern bool afs_check_validity(struct afs_vnode *);
10751073
extern int afs_validate(struct afs_vnode *, struct key *);
10761074
extern int afs_getattr(const struct path *, struct kstat *, u32, unsigned int);

fs/afs/proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ void afs_put_sysnames(struct afs_sysnames *sysnames)
567567
if (sysnames->subs[i] != afs_init_sysname &&
568568
sysnames->subs[i] != sysnames->blank)
569569
kfree(sysnames->subs[i]);
570+
kfree(sysnames);
570571
}
571572
}
572573

fs/afs/vl_alias.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static struct afs_volume *afs_sample_volume(struct afs_cell *cell, struct key *k
2828
};
2929

3030
volume = afs_create_volume(&fc);
31-
_leave(" = %px", volume);
31+
_leave(" = %p", volume);
3232
return volume;
3333
}
3434

@@ -73,7 +73,8 @@ static int afs_compare_addrs(const struct sockaddr_rxrpc *srx_a,
7373
}
7474

7575
default:
76-
BUG();
76+
WARN_ON(1);
77+
diff = 1;
7778
}
7879

7980
out:

fs/afs/yfsclient.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include "xdr_fs.h"
1616
#include "protocol_yfs.h"
1717

18-
static const struct afs_fid afs_zero_fid;
19-
2018
#define xdr_size(x) (sizeof(*x) / sizeof(__be32))
2119

2220
static void xdr_decode_YFSFid(const __be32 **_bp, struct afs_fid *fid)

0 commit comments

Comments
 (0)