]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/linux-2.6/xfs_lrw.c
[PATCH] r/o bind mounts: elevate count for xfs timestamp updates
[linux-2.6-omap-h63xx.git] / fs / xfs / linux-2.6 / xfs_lrw.c
index 21c0dbc74093b2bcf62971d58ff3a6b0168d27f1..1ebd8004469c1d3a70a0afc0f8a34f8400ea5011 100644 (file)
@@ -51,6 +51,7 @@
 #include "xfs_vnodeops.h"
 
 #include <linux/capability.h>
+#include <linux/mount.h>
 #include <linux/writeback.h>
 
 
@@ -670,10 +671,16 @@ start:
        if (new_size > xip->i_size)
                xip->i_new_size = new_size;
 
-       if (likely(!(ioflags & IO_INVIS))) {
+       /*
+        * We're not supposed to change timestamps in readonly-mounted
+        * filesystems.  Throw it away if anyone asks us.
+        */
+       if (likely(!(ioflags & IO_INVIS) &&
+                  !mnt_want_write(file->f_path.mnt))) {
                file_update_time(file);
                xfs_ichgtime_fast(xip, inode,
                                  XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
+               mnt_drop_write(file->f_path.mnt);
        }
 
        /*