aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-24 09:45:57 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-25 09:41:25 -0500
commit0411e7353192d7deebd4f50b9ee41974ec3a634c (patch)
tree059c8f96ee9692818f16f0761b41a63e72cb9ced /drivers/mtd
parent91f2d53cd75a8fa3557246af965155208c4c69a7 (diff)
UBI: do not change file pointer while updating
Since we do not change semantics of seek(), changing the file pointer while updating does not make much sense. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/cdev.c4
-rw-r--r--drivers/mtd/ubi/upd.c1
2 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index a7aa123afaf6..d9bd49421cce 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -368,6 +368,7 @@ static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
368 */ 368 */
369 count = err; 369 count = err;
370 370
371 vol->updating = 0;
371 err = ubi_check_volume(ubi, vol->vol_id); 372 err = ubi_check_volume(ubi, vol->vol_id);
372 if (err < 0) 373 if (err < 0)
373 return err; 374 return err;
@@ -382,7 +383,6 @@ static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
382 revoke_exclusive(desc, UBI_READWRITE); 383 revoke_exclusive(desc, UBI_READWRITE);
383 } 384 }
384 385
385 *offp += count;
386 return count; 386 return count;
387} 387}
388 388
@@ -430,8 +430,6 @@ static int vol_cdev_ioctl(struct inode *inode, struct file *file,
430 err = ubi_start_update(ubi, vol->vol_id, bytes); 430 err = ubi_start_update(ubi, vol->vol_id, bytes);
431 if (bytes == 0) 431 if (bytes == 0)
432 revoke_exclusive(desc, UBI_READWRITE); 432 revoke_exclusive(desc, UBI_READWRITE);
433
434 file->f_pos = 0;
435 break; 433 break;
436 } 434 }
437 435
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
index e32b04d2e048..3defa579fab0 100644
--- a/drivers/mtd/ubi/upd.c
+++ b/drivers/mtd/ubi/upd.c
@@ -343,7 +343,6 @@ int ubi_more_update_data(struct ubi_device *ubi, int vol_id,
343 if (err == 0) { 343 if (err == 0) {
344 err = to_write; 344 err = to_write;
345 vfree(vol->upd_buf); 345 vfree(vol->upd_buf);
346 vol->updating = 0;
347 } 346 }
348 } 347 }
349 348