Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7eafaed55f4b8599cfe55449a6ed88d3693954de
Commit:     7eafaed55f4b8599cfe55449a6ed88d3693954de
Parent:     fd5324909e410a3202c1b01bd507c2dfba58fca5
Author:     Joakim Tjernlund <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 27 00:56:40 2007 +0200
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Thu Jun 28 18:40:32 2007 +0100

    [MTD] Only call mtd->sync() method in mtdchar close if opened for write.
    
    Signed-off-by: Joakim Tjernlund <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 drivers/mtd/mtdchar.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 8c86b80..942c88e 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -135,7 +135,8 @@ static int mtd_close(struct inode *inode, struct file *file)
 
        DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n");
 
-       if (mtd->sync)
+       /* Only sync if opened RW */
+       if ((file->f_mode & 2) && mtd->sync)
                mtd->sync(mtd);
 
        put_mtd_device(mtd);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to