On Thursday, 16 September, 2010, Mike Fedyk wrote: > On Mon, Sep 13, 2010 at 12:24 PM, Goffredo Baroncelli > <kreij...@gmail.com> wrote: [...] > > + > > + if(ret != 0) > > + { > > + fprintf(stderr, "FATAL: the filesystem has to be > > unmounted\n"); > > + return -2; > > + } > > + get_label_unmounted(btrfs_dev); > > + return 0; > > +} > > + > > + > > Why can't the label be read while the fs is mounted? It shouldn't > hurt anything. I can read the superblock on my ext3 fs while it's > mounted... This is what people have come to expect.
The main reason is that if a filesystem is mounted, the data read from userspace may be outdated by the internal data. In the original patch (the one of Morey Roof), there was a kernel space code that handled this case. In order to simplify the patch I split the code in two step the user space and the kernel space. This is the user space portion, and because it has to work without the kernel space portion, when it is required the code fail explicitly. I hope to publish the 2nd patch during the next weeks. Regards G.Baroncelli -- gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreij...@inwind.it> Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html