LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-03-2013, 01:05 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
What does the 10 mean in "inotify_add_watch(6, /dev/dm-4, 10) failed ..."


The full error message text, from syslog is
Code:
inotify_add_watch(6, /dev/dm-4, 10) failed: No such file or directory
According to the inotify_add_watch man page, the 10 is a bitmask documented in the inotify (7) man page with meanings as assigned in /usr/include/linux/inotify.h.
  • If it is hexadecimal it means "Unwrittable file closed" (sic)
  • If it is decimal it is 0x8 and 0x2 and means ""Unwrittable file closed" (sic) and "File was modified"
  • If it is binary it means "File was modified"
None of those fit well with the presumed intention of detecting a u/mount event to a device-mapper device (in this case an LVM snapshot). The 3rd interpretation would fit with detecting a write event.

The inotify_add_watch may be run by udev via a rule in /lib/udev/rules.d/80-udisks.rules, which is part of the udisks package:
Code:
# Make udevd synthesize a 'change' uevent when last opener of a rw-fd closes the fd - this
# should be part of the device-mapper rules
KERNEL=="dm-*", OPTIONS+="watch"
Similar error messages appear for LVM snapshots which are successfully removed by lvremove; no such message appears for a snapshot that lvremove does not remove with message "Can't remove open logical volume "snap-var"".

I am trying to understand what is going on with the intention of finding a workaround; the best related discussion was found in a Red Hat bug report at https://bugzilla.redhat.com/show_bug.cgi?id=753105

In case it makes any difference, this is on an ubuntu 12.04 server with lvm2 2.02.66, udev 175-0 and udisks 1.0.4
 
Old 09-03-2013, 06:58 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Most messages print numbers as decimal or else explicitly precede them with 0x for hex, so I think it is "File was modified or closed". Note that multiple mask bits are "or" not "and".

That udev rule seems a little iffy. It has comments: "hmm, this might be racy", and "TODO: this heuristic might need some work". So I would not be surprised at some problems. After the error do you have a /dev/dm-4?
 
Old 09-10-2013, 04:13 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks smallpond

"After the error do you have a /dev/dm-4?" No, at least not when I look. I'm far from having a clear picture of what's going on but I interpret this to mean that lvremove has been able to remove the LVM volume because it caught it at a time when udev's udisk rule wasn't making it busy. This results in /dev/dm-4 being removed and hence the error message.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
curlftpfs mount fails with "fuse: failed to open /dev/fuse: Permission denied" camperbait Linux - General 2 06-12-2013 11:32 AM
when use minicom, received "Device /dev/ttyS1 access failed: Permission denied." fulee1 Linux - Newbie 3 04-02-2010 03:11 PM
hdparm -d1 /dev/hda gives me "HDIO_SET_DMA failed: Operation not permitted" elluva Linux - Hardware 7 07-21-2007 03:49 AM
How do I switch the labels "/dev/sda1" with "/dev/sda3" vonst Linux - General 10 05-27-2006 10:48 PM
Mandriva 2006 fails install with "set_loop failed on /dev/loop0" iguest Mandriva 5 05-07-2006 01:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration