]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
UBI: do not change file pointer while updating
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 24 Jan 2008 14:45:57 +0000 (16:45 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 25 Jan 2008 14:41:25 +0000 (16:41 +0200)
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>
drivers/mtd/ubi/cdev.c
drivers/mtd/ubi/upd.c

index a7aa123afaf6ec94558b10ff0a86e7879ba1d580..d9bd49421ccea4eb2f5f8cd4393c368e34acd3eb 100644 (file)
@@ -368,6 +368,7 @@ static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
                 */
                count = err;
 
+               vol->updating = 0;
                err = ubi_check_volume(ubi, vol->vol_id);
                if (err < 0)
                        return err;
@@ -382,7 +383,6 @@ static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
                revoke_exclusive(desc, UBI_READWRITE);
        }
 
-       *offp += count;
        return count;
 }
 
@@ -430,8 +430,6 @@ static int vol_cdev_ioctl(struct inode *inode, struct file *file,
                err = ubi_start_update(ubi, vol->vol_id, bytes);
                if (bytes == 0)
                        revoke_exclusive(desc, UBI_READWRITE);
-
-               file->f_pos = 0;
                break;
        }
 
index e32b04d2e0488ab45a65eddc213153031dd4169f..3defa579fab06a9e32905486466389f5108d40b1 100644 (file)
@@ -343,7 +343,6 @@ int ubi_more_update_data(struct ubi_device *ubi, int vol_id,
                if (err == 0) {
                        err = to_write;
                        vfree(vol->upd_buf);
-                       vol->updating = 0;
                }
        }