Skip to content

Commit 7e5cd6f

Browse files
committed
Merge tag 'jfs-6.6' of github.com:kleikamp/linux-shaggy
Pull jfs updates from Dave Kleikamp: "A few small fixes" * tag 'jfs-6.6' of github.com:kleikamp/linux-shaggy: jfs: validate max amount of blocks before allocation. jfs: remove redundant initialization to pointer ip jfs: fix invalid free of JFS_IP(ipimap)->i_imap in diUnmount FS: JFS: (trivial) Fix grammatical error in extAlloc fs/jfs: prevent double-free in dbUnmount() after failed jfs_remount()
2 parents 3ef96fc + 0225e10 commit 7e5cd6f

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

fs/jfs/jfs_dmap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ int dbUnmount(struct inode *ipbmap, int mounterror)
269269

270270
/* free the memory for the in-memory bmap. */
271271
kfree(bmp);
272+
JFS_SBI(ipbmap->i_sb)->bmap = NULL;
272273

273274
return (0);
274275
}

fs/jfs/jfs_extent.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
166166
/*
167167
* COMMIT_SyncList flags an anonymous tlock on page that is on
168168
* sync list.
169-
* We need to commit the inode to get the page written disk.
169+
* We need to commit the inode to get the page written to the disk.
170170
*/
171171
if (test_and_clear_cflag(COMMIT_Synclist,ip))
172172
jfs_commit_inode(ip, 0);
@@ -311,6 +311,11 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
311311
* blocks in the map. in that case, we'll start off with the
312312
* maximum free.
313313
*/
314+
315+
/* give up if no space left */
316+
if (bmp->db_maxfreebud == -1)
317+
return -ENOSPC;
318+
314319
max = (s64) 1 << bmp->db_maxfreebud;
315320
if (*nblocks >= max && *nblocks > nbperpage)
316321
nb = nblks = (max > nbperpage) ? max : nbperpage;

fs/jfs/jfs_imap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ int diUnmount(struct inode *ipimap, int mounterror)
193193
* free in-memory control structure
194194
*/
195195
kfree(imap);
196+
JFS_IP(ipimap)->i_imap = NULL;
196197

197198
return (0);
198199
}

fs/jfs/namei.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip,
883883
struct component_name dname;
884884
u32 ssize; /* source pathname size */
885885
struct btstack btstack;
886-
struct inode *ip = d_inode(dentry);
886+
struct inode *ip;
887887
s64 xlen = 0;
888888
int bmask = 0, xsize;
889889
s64 xaddr;

0 commit comments

Comments
 (0)