Commit 7e5cd6f6 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 3ef96fcf 0225e109
...@@ -269,6 +269,7 @@ int dbUnmount(struct inode *ipbmap, int mounterror) ...@@ -269,6 +269,7 @@ int dbUnmount(struct inode *ipbmap, int mounterror)
/* free the memory for the in-memory bmap. */ /* free the memory for the in-memory bmap. */
kfree(bmp); kfree(bmp);
JFS_SBI(ipbmap->i_sb)->bmap = NULL;
return (0); return (0);
} }
......
...@@ -166,7 +166,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr) ...@@ -166,7 +166,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
/* /*
* COMMIT_SyncList flags an anonymous tlock on page that is on * COMMIT_SyncList flags an anonymous tlock on page that is on
* sync list. * sync list.
* We need to commit the inode to get the page written disk. * We need to commit the inode to get the page written to the disk.
*/ */
if (test_and_clear_cflag(COMMIT_Synclist,ip)) if (test_and_clear_cflag(COMMIT_Synclist,ip))
jfs_commit_inode(ip, 0); jfs_commit_inode(ip, 0);
...@@ -311,6 +311,11 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) ...@@ -311,6 +311,11 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
* blocks in the map. in that case, we'll start off with the * blocks in the map. in that case, we'll start off with the
* maximum free. * maximum free.
*/ */
/* give up if no space left */
if (bmp->db_maxfreebud == -1)
return -ENOSPC;
max = (s64) 1 << bmp->db_maxfreebud; max = (s64) 1 << bmp->db_maxfreebud;
if (*nblocks >= max && *nblocks > nbperpage) if (*nblocks >= max && *nblocks > nbperpage)
nb = nblks = (max > nbperpage) ? max : nbperpage; nb = nblks = (max > nbperpage) ? max : nbperpage;
......
...@@ -193,6 +193,7 @@ int diUnmount(struct inode *ipimap, int mounterror) ...@@ -193,6 +193,7 @@ int diUnmount(struct inode *ipimap, int mounterror)
* free in-memory control structure * free in-memory control structure
*/ */
kfree(imap); kfree(imap);
JFS_IP(ipimap)->i_imap = NULL;
return (0); return (0);
} }
......
...@@ -883,7 +883,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip, ...@@ -883,7 +883,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip,
struct component_name dname; struct component_name dname;
u32 ssize; /* source pathname size */ u32 ssize; /* source pathname size */
struct btstack btstack; struct btstack btstack;
struct inode *ip = d_inode(dentry); struct inode *ip;
s64 xlen = 0; s64 xlen = 0;
int bmask = 0, xsize; int bmask = 0, xsize;
s64 xaddr; s64 xaddr;
......
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