aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 13:17:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 13:17:30 -0400
commitc29aa153ef0469cddf0146d41ce6494bd76be78b (patch)
treeb49af4e6cf54e9988dd45640a86c4de7f49ddf6d /fs
parent2b3a8fd735f86ebeb2b9d061054003000c36b654 (diff)
parent4a4163caccae97a23d97c29032664ee7b7a498d0 (diff)
Merge tag 'for-linus-20140405' of git://git.infradead.org/linux-mtd
Pull MTD updates from Brian Norris: - A few SPI NOR ID definitions - Kill the NAND "max pagesize" restriction - Fix some x16 bus-width NAND support - Add NAND JEDEC parameter page support - DT bindings for NAND ECC - GPMI NAND updates (subpage reads) - More OMAP NAND refactoring - New STMicro SPI NOR driver (now in 40 patches!) - A few other random bugfixes * tag 'for-linus-20140405' of git://git.infradead.org/linux-mtd: (120 commits) Fix index regression in nand_read_subpage mtd: diskonchip: mem resource name is not optional mtd: nand: fix mention to CONFIG_MTD_NAND_ECC_BCH mtd: nand: fix GET/SET_FEATURES address on 16-bit devices mtd: omap2: Use devm_ioremap_resource() mtd: denali_dt: Use devm_ioremap_resource() mtd: devices: elm: update DRIVER_NAME as "omap-elm" mtd: devices: elm: configure parallel channels based on ecc_steps mtd: devices: elm: clean elm_load_syndrome mtd: devices: elm: check for hardware engine's design constraints mtd: st_spi_fsm: Succinctly reorganise .remove() mtd: st_spi_fsm: Allow loop to run at least once before giving up CPU mtd: st_spi_fsm: Correct vendor name spelling issue - missing "M" mtd: st_spi_fsm: Avoid duplicating MTD core code mtd: st_spi_fsm: Remove useless consts from function arguments mtd: st_spi_fsm: Convert ST SPI FSM (NOR) Flash driver to new DT partitions mtd: st_spi_fsm: Move runtime configurable msg sequences into device's struct mtd: st_spi_fsm: Supply the W25Qxxx chip specific configuration call-back mtd: st_spi_fsm: Supply the S25FLxxx chip specific configuration call-back mtd: st_spi_fsm: Supply the MX25xxx chip specific configuration call-back ...
Diffstat (limited to 'fs')
-rw-r--r--fs/jffs2/compr_rtime.c4
-rw-r--r--fs/jffs2/fs.c9
-rw-r--r--fs/jffs2/nodelist.h2
-rw-r--r--fs/jffs2/nodemgmt.c14
4 files changed, 19 insertions, 10 deletions
diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c
index 16a5047903a6..406d9cc84ba8 100644
--- a/fs/jffs2/compr_rtime.c
+++ b/fs/jffs2/compr_rtime.c
@@ -33,7 +33,7 @@ static int jffs2_rtime_compress(unsigned char *data_in,
33 unsigned char *cpage_out, 33 unsigned char *cpage_out,
34 uint32_t *sourcelen, uint32_t *dstlen) 34 uint32_t *sourcelen, uint32_t *dstlen)
35{ 35{
36 short positions[256]; 36 unsigned short positions[256];
37 int outpos = 0; 37 int outpos = 0;
38 int pos=0; 38 int pos=0;
39 39
@@ -74,7 +74,7 @@ static int jffs2_rtime_decompress(unsigned char *data_in,
74 unsigned char *cpage_out, 74 unsigned char *cpage_out,
75 uint32_t srclen, uint32_t destlen) 75 uint32_t srclen, uint32_t destlen)
76{ 76{
77 short positions[256]; 77 unsigned short positions[256];
78 int outpos = 0; 78 int outpos = 0;
79 int pos=0; 79 int pos=0;
80 80
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index f73991522672..601afd1afddf 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -457,12 +457,14 @@ struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_r
457 The umask is only applied if there's no default ACL */ 457 The umask is only applied if there's no default ACL */
458 ret = jffs2_init_acl_pre(dir_i, inode, &mode); 458 ret = jffs2_init_acl_pre(dir_i, inode, &mode);
459 if (ret) { 459 if (ret) {
460 make_bad_inode(inode); 460 mutex_unlock(&f->sem);
461 iput(inode); 461 make_bad_inode(inode);
462 return ERR_PTR(ret); 462 iput(inode);
463 return ERR_PTR(ret);
463 } 464 }
464 ret = jffs2_do_new_inode (c, f, mode, ri); 465 ret = jffs2_do_new_inode (c, f, mode, ri);
465 if (ret) { 466 if (ret) {
467 mutex_unlock(&f->sem);
466 make_bad_inode(inode); 468 make_bad_inode(inode);
467 iput(inode); 469 iput(inode);
468 return ERR_PTR(ret); 470 return ERR_PTR(ret);
@@ -479,6 +481,7 @@ struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_r
479 inode->i_size = 0; 481 inode->i_size = 0;
480 482
481 if (insert_inode_locked(inode) < 0) { 483 if (insert_inode_locked(inode) < 0) {
484 mutex_unlock(&f->sem);
482 make_bad_inode(inode); 485 make_bad_inode(inode);
483 iput(inode); 486 iput(inode);
484 return ERR_PTR(-EINVAL); 487 return ERR_PTR(-EINVAL);
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h
index e4619b00f7c5..fa35ff79ab35 100644
--- a/fs/jffs2/nodelist.h
+++ b/fs/jffs2/nodelist.h
@@ -231,7 +231,7 @@ struct jffs2_tmp_dnode_info
231 uint32_t version; 231 uint32_t version;
232 uint32_t data_crc; 232 uint32_t data_crc;
233 uint32_t partial_crc; 233 uint32_t partial_crc;
234 uint16_t csize; 234 uint32_t csize;
235 uint16_t overlapped; 235 uint16_t overlapped;
236}; 236};
237 237
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index 03310721712f..b6bd4affd9ad 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -179,6 +179,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
179 spin_unlock(&c->erase_completion_lock); 179 spin_unlock(&c->erase_completion_lock);
180 180
181 schedule(); 181 schedule();
182 remove_wait_queue(&c->erase_wait, &wait);
182 } else 183 } else
183 spin_unlock(&c->erase_completion_lock); 184 spin_unlock(&c->erase_completion_lock);
184 } else if (ret) 185 } else if (ret)
@@ -211,20 +212,25 @@ out:
211int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, 212int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize,
212 uint32_t *len, uint32_t sumsize) 213 uint32_t *len, uint32_t sumsize)
213{ 214{
214 int ret = -EAGAIN; 215 int ret;
215 minsize = PAD(minsize); 216 minsize = PAD(minsize);
216 217
217 jffs2_dbg(1, "%s(): Requested 0x%x bytes\n", __func__, minsize); 218 jffs2_dbg(1, "%s(): Requested 0x%x bytes\n", __func__, minsize);
218 219
219 spin_lock(&c->erase_completion_lock); 220 while (true) {
220 while(ret == -EAGAIN) { 221 spin_lock(&c->erase_completion_lock);
221 ret = jffs2_do_reserve_space(c, minsize, len, sumsize); 222 ret = jffs2_do_reserve_space(c, minsize, len, sumsize);
222 if (ret) { 223 if (ret) {
223 jffs2_dbg(1, "%s(): looping, ret is %d\n", 224 jffs2_dbg(1, "%s(): looping, ret is %d\n",
224 __func__, ret); 225 __func__, ret);
225 } 226 }
227 spin_unlock(&c->erase_completion_lock);
228
229 if (ret == -EAGAIN)
230 cond_resched();
231 else
232 break;
226 } 233 }
227 spin_unlock(&c->erase_completion_lock);
228 if (!ret) 234 if (!ret)
229 ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, 1); 235 ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, 1);
230 236